Romain Guy | 0ab985c | 2011-03-17 11:06:57 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 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_DRAW_GL_INFO_H |
| 18 | #define ANDROID_HWUI_DRAW_GL_INFO_H |
| 19 | |
| 20 | namespace android { |
| 21 | namespace uirenderer { |
| 22 | |
| 23 | /** |
| 24 | * Structure used by OpenGLRenderer::callDrawGLFunction() to pass and |
| 25 | * receive data from OpenGL functors. |
| 26 | */ |
| 27 | struct DrawGlInfo { |
| 28 | // Input: current clip rect |
| 29 | int clipLeft; |
| 30 | int clipTop; |
| 31 | int clipRight; |
| 32 | int clipBottom; |
| 33 | |
| 34 | // Input: is the render target an FBO |
| 35 | bool isLayer; |
| 36 | |
| 37 | // Input: current transform matrix, in OpenGL format |
| 38 | float transform[16]; |
| 39 | |
| 40 | // Output: dirty region to redraw |
| 41 | float dirtyLeft; |
| 42 | float dirtyTop; |
| 43 | float dirtyRight; |
| 44 | float dirtyBottom; |
Romain Guy | 00a10e8 | 2012-03-26 16:45:05 -0700 | [diff] [blame^] | 45 | |
| 46 | /** |
| 47 | * Values used by OpenGL functors to tell the framework |
| 48 | * what to do next. |
| 49 | */ |
| 50 | enum Status { |
| 51 | // The functor is done |
| 52 | kStatusDone, |
| 53 | // The functor is requesting a redraw (the clip rect |
| 54 | // used by the redraw is specified by DrawGlInfo.) |
| 55 | // The rest of the UI might redraw too. |
| 56 | kStatusDraw, |
| 57 | // The functor needs to be invoked again but will |
| 58 | // not redraw. Only the functor is invoked again |
| 59 | // (unless another functor requests a redraw.) |
| 60 | kStatusInvoke |
| 61 | }; |
Romain Guy | 0ab985c | 2011-03-17 11:06:57 -0700 | [diff] [blame] | 62 | }; // struct DrawGlInfo |
| 63 | |
| 64 | }; // namespace uirenderer |
| 65 | }; // namespace android |
| 66 | |
| 67 | #endif // ANDROID_HWUI_DRAW_GL_INFO_H |