Chris Craik | 9e7fcfd | 2015-11-25 13:27:33 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef ANDROID_HWUI_BAKED_OP_DISPATCHER_H |
| 18 | #define ANDROID_HWUI_BAKED_OP_DISPATCHER_H |
| 19 | |
| 20 | #include "BakedOpState.h" |
| 21 | #include "RecordedOp.h" |
| 22 | |
| 23 | namespace android { |
| 24 | namespace uirenderer { |
| 25 | |
| 26 | /** |
| 27 | * Provides all "onBitmapOp(...)" style static methods for every op type, which convert the |
| 28 | * RecordedOps and their state to Glops, and renders them with the provided BakedOpRenderer. |
Chris Craik | 386aa03 | 2015-12-07 17:08:25 -0800 | [diff] [blame] | 29 | * |
| 30 | * onXXXOp methods must either render directly with the renderer, or call a static renderYYY |
| 31 | * method to render content. There should never be draw content rejection in BakedOpDispatcher - |
| 32 | * it must happen at a higher level (except in error-ish cases, like texture-too-big). |
Chris Craik | 9e7fcfd | 2015-11-25 13:27:33 -0800 | [diff] [blame] | 33 | */ |
| 34 | class BakedOpDispatcher { |
| 35 | public: |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 36 | // Declares all "onMergedBitmapOps(...)" style methods for mergeable op types |
Chris Craik | 15c3f19 | 2015-12-03 12:16:56 -0800 | [diff] [blame] | 37 | #define X(Type) \ |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 38 | static void onMerged##Type##s(BakedOpRenderer& renderer, const MergedBakedOpList& opList); |
Chris Craik | 7cbf63d | 2016-01-06 13:46:52 -0800 | [diff] [blame] | 39 | MAP_MERGEABLE_OPS(X) |
Chris Craik | 15c3f19 | 2015-12-03 12:16:56 -0800 | [diff] [blame] | 40 | #undef X |
| 41 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 42 | // Declares all "onBitmapOp(...)" style methods for every op type |
Chris Craik | 15c3f19 | 2015-12-03 12:16:56 -0800 | [diff] [blame] | 43 | #define X(Type) \ |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 44 | static void on##Type(BakedOpRenderer& renderer, const Type& op, const BakedOpState& state); |
Chris Craik | 7cbf63d | 2016-01-06 13:46:52 -0800 | [diff] [blame] | 45 | MAP_RENDERABLE_OPS(X) |
Chris Craik | 15c3f19 | 2015-12-03 12:16:56 -0800 | [diff] [blame] | 46 | #undef X |
Chris Craik | 9e7fcfd | 2015-11-25 13:27:33 -0800 | [diff] [blame] | 47 | }; |
| 48 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 49 | }; // namespace uirenderer |
| 50 | }; // namespace android |
Chris Craik | 9e7fcfd | 2015-11-25 13:27:33 -0800 | [diff] [blame] | 51 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 52 | #endif // ANDROID_HWUI_BAKED_OP_DISPATCHER_H |