19e7fcfda28fde747ba4e026772007cea77374e16Chris Craik/*
29e7fcfda28fde747ba4e026772007cea77374e16Chris Craik * Copyright (C) 2015 The Android Open Source Project
39e7fcfda28fde747ba4e026772007cea77374e16Chris Craik *
49e7fcfda28fde747ba4e026772007cea77374e16Chris Craik * Licensed under the Apache License, Version 2.0 (the "License");
59e7fcfda28fde747ba4e026772007cea77374e16Chris Craik * you may not use this file except in compliance with the License.
69e7fcfda28fde747ba4e026772007cea77374e16Chris Craik * You may obtain a copy of the License at
79e7fcfda28fde747ba4e026772007cea77374e16Chris Craik *
89e7fcfda28fde747ba4e026772007cea77374e16Chris Craik *      http://www.apache.org/licenses/LICENSE-2.0
99e7fcfda28fde747ba4e026772007cea77374e16Chris Craik *
109e7fcfda28fde747ba4e026772007cea77374e16Chris Craik * Unless required by applicable law or agreed to in writing, software
119e7fcfda28fde747ba4e026772007cea77374e16Chris Craik * distributed under the License is distributed on an "AS IS" BASIS,
129e7fcfda28fde747ba4e026772007cea77374e16Chris Craik * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
139e7fcfda28fde747ba4e026772007cea77374e16Chris Craik * See the License for the specific language governing permissions and
149e7fcfda28fde747ba4e026772007cea77374e16Chris Craik * limitations under the License.
159e7fcfda28fde747ba4e026772007cea77374e16Chris Craik */
169e7fcfda28fde747ba4e026772007cea77374e16Chris Craik
179e7fcfda28fde747ba4e026772007cea77374e16Chris Craik#ifndef ANDROID_HWUI_BAKED_OP_DISPATCHER_H
189e7fcfda28fde747ba4e026772007cea77374e16Chris Craik#define ANDROID_HWUI_BAKED_OP_DISPATCHER_H
199e7fcfda28fde747ba4e026772007cea77374e16Chris Craik
209e7fcfda28fde747ba4e026772007cea77374e16Chris Craik#include "BakedOpState.h"
219e7fcfda28fde747ba4e026772007cea77374e16Chris Craik#include "RecordedOp.h"
229e7fcfda28fde747ba4e026772007cea77374e16Chris Craik
239e7fcfda28fde747ba4e026772007cea77374e16Chris Craiknamespace android {
249e7fcfda28fde747ba4e026772007cea77374e16Chris Craiknamespace uirenderer {
259e7fcfda28fde747ba4e026772007cea77374e16Chris Craik
269e7fcfda28fde747ba4e026772007cea77374e16Chris Craik/**
279e7fcfda28fde747ba4e026772007cea77374e16Chris Craik * Provides all "onBitmapOp(...)" style static methods for every op type, which convert the
289e7fcfda28fde747ba4e026772007cea77374e16Chris Craik * RecordedOps and their state to Glops, and renders them with the provided BakedOpRenderer.
29386aa031793bb037ec43b6cdbd8908c343cc86cbChris Craik *
30386aa031793bb037ec43b6cdbd8908c343cc86cbChris Craik * onXXXOp methods must either render directly with the renderer, or call a static renderYYY
31386aa031793bb037ec43b6cdbd8908c343cc86cbChris Craik * method to render content. There should never be draw content rejection in BakedOpDispatcher -
32386aa031793bb037ec43b6cdbd8908c343cc86cbChris Craik * it must happen at a higher level (except in error-ish cases, like texture-too-big).
339e7fcfda28fde747ba4e026772007cea77374e16Chris Craik */
349e7fcfda28fde747ba4e026772007cea77374e16Chris Craikclass BakedOpDispatcher {
359e7fcfda28fde747ba4e026772007cea77374e16Chris Craikpublic:
3615c3f19a445b8df575911a16e8a6dba755a084b5Chris Craik    // Declares all "onMergedBitmapOps(...)" style methods for mergeable op types
3715c3f19a445b8df575911a16e8a6dba755a084b5Chris Craik#define X(Type) \
3815c3f19a445b8df575911a16e8a6dba755a084b5Chris Craik        static void onMerged##Type##s(BakedOpRenderer& renderer, const MergedBakedOpList& opList);
397cbf63da4f29e5a6b131796eb3b67fd9ff1521b8Chris Craik    MAP_MERGEABLE_OPS(X)
4015c3f19a445b8df575911a16e8a6dba755a084b5Chris Craik#undef X
4115c3f19a445b8df575911a16e8a6dba755a084b5Chris Craik
429e7fcfda28fde747ba4e026772007cea77374e16Chris Craik    // Declares all "onBitmapOp(...)" style methods for every op type
4315c3f19a445b8df575911a16e8a6dba755a084b5Chris Craik#define X(Type) \
449e7fcfda28fde747ba4e026772007cea77374e16Chris Craik        static void on##Type(BakedOpRenderer& renderer, const Type& op, const BakedOpState& state);
457cbf63da4f29e5a6b131796eb3b67fd9ff1521b8Chris Craik    MAP_RENDERABLE_OPS(X)
4615c3f19a445b8df575911a16e8a6dba755a084b5Chris Craik#undef X
4715c3f19a445b8df575911a16e8a6dba755a084b5Chris Craik
489e7fcfda28fde747ba4e026772007cea77374e16Chris Craik};
499e7fcfda28fde747ba4e026772007cea77374e16Chris Craik
509e7fcfda28fde747ba4e026772007cea77374e16Chris Craik}; // namespace uirenderer
519e7fcfda28fde747ba4e026772007cea77374e16Chris Craik}; // namespace android
529e7fcfda28fde747ba4e026772007cea77374e16Chris Craik
539e7fcfda28fde747ba4e026772007cea77374e16Chris Craik#endif // ANDROID_HWUI_BAKED_OP_DISPATCHER_H
54