blob: caf14bfeef6d50d13bf9b182d8ebb4afbf3d5e85 [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
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.
29 *
30 * This dispatcher is separate from the renderer so that the dispatcher / renderer interaction is
31 * minimal through public BakedOpRenderer APIs.
32 */
33class BakedOpDispatcher {
34public:
35 // Declares all "onBitmapOp(...)" style methods for every op type
36#define DISPATCH_METHOD(Type) \
37 static void on##Type(BakedOpRenderer& renderer, const Type& op, const BakedOpState& state);
38 MAP_OPS(DISPATCH_METHOD);
39};
40
41}; // namespace uirenderer
42}; // namespace android
43
44#endif // ANDROID_HWUI_BAKED_OP_DISPATCHER_H