blob: cc3287075ef8851f03e801d54f6fe781ccf99263 [file] [log] [blame]
Chris Craik9e7fcfd2015-11-25 13:27:33 -08001/*
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
23namespace android {
24namespace uirenderer {
25
Mike Reedebf9ffc2018-05-02 11:20:38 -040026class BakedOpRenderer;
27
Chris Craik9e7fcfd2015-11-25 13:27:33 -080028/**
29 * Provides all "onBitmapOp(...)" style static methods for every op type, which convert the
30 * RecordedOps and their state to Glops, and renders them with the provided BakedOpRenderer.
Chris Craik386aa032015-12-07 17:08:25 -080031 *
32 * onXXXOp methods must either render directly with the renderer, or call a static renderYYY
33 * method to render content. There should never be draw content rejection in BakedOpDispatcher -
34 * it must happen at a higher level (except in error-ish cases, like texture-too-big).
Chris Craik9e7fcfd2015-11-25 13:27:33 -080035 */
36class BakedOpDispatcher {
37public:
John Reck1bcacfd2017-11-03 10:12:19 -070038// Declares all "onMergedBitmapOps(...)" style methods for mergeable op types
Chris Craik15c3f192015-12-03 12:16:56 -080039#define X(Type) \
John Reck1bcacfd2017-11-03 10:12:19 -070040 static void onMerged##Type##s(BakedOpRenderer& renderer, const MergedBakedOpList& opList);
Chris Craik7cbf63d2016-01-06 13:46:52 -080041 MAP_MERGEABLE_OPS(X)
Chris Craik15c3f192015-12-03 12:16:56 -080042#undef X
43
John Reck1bcacfd2017-11-03 10:12:19 -070044// Declares all "onBitmapOp(...)" style methods for every op type
Chris Craik15c3f192015-12-03 12:16:56 -080045#define X(Type) \
John Reck1bcacfd2017-11-03 10:12:19 -070046 static void on##Type(BakedOpRenderer& renderer, const Type& op, const BakedOpState& state);
Chris Craik7cbf63d2016-01-06 13:46:52 -080047 MAP_RENDERABLE_OPS(X)
Chris Craik15c3f192015-12-03 12:16:56 -080048#undef X
Chris Craik9e7fcfd2015-11-25 13:27:33 -080049};
50
John Reck1bcacfd2017-11-03 10:12:19 -070051}; // namespace uirenderer
52}; // namespace android
Chris Craik9e7fcfd2015-11-25 13:27:33 -080053
John Reck1bcacfd2017-11-03 10:12:19 -070054#endif // ANDROID_HWUI_BAKED_OP_DISPATCHER_H