Snapshot.h revision 3f085429fd47ebd32ac2463b3eae2a5a6c17be25
15cbbce535744b89df5ecea95de21ee3733298260Romain Guy/*
25cbbce535744b89df5ecea95de21ee3733298260Romain Guy * Copyright (C) 2010 The Android Open Source Project
35cbbce535744b89df5ecea95de21ee3733298260Romain Guy *
45cbbce535744b89df5ecea95de21ee3733298260Romain Guy * Licensed under the Apache License, Version 2.0 (the "License");
55cbbce535744b89df5ecea95de21ee3733298260Romain Guy * you may not use this file except in compliance with the License.
65cbbce535744b89df5ecea95de21ee3733298260Romain Guy * You may obtain a copy of the License at
75cbbce535744b89df5ecea95de21ee3733298260Romain Guy *
85cbbce535744b89df5ecea95de21ee3733298260Romain Guy *      http://www.apache.org/licenses/LICENSE-2.0
95cbbce535744b89df5ecea95de21ee3733298260Romain Guy *
105cbbce535744b89df5ecea95de21ee3733298260Romain Guy * Unless required by applicable law or agreed to in writing, software
115cbbce535744b89df5ecea95de21ee3733298260Romain Guy * distributed under the License is distributed on an "AS IS" BASIS,
125cbbce535744b89df5ecea95de21ee3733298260Romain Guy * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
135cbbce535744b89df5ecea95de21ee3733298260Romain Guy * See the License for the specific language governing permissions and
145cbbce535744b89df5ecea95de21ee3733298260Romain Guy * limitations under the License.
155cbbce535744b89df5ecea95de21ee3733298260Romain Guy */
165cbbce535744b89df5ecea95de21ee3733298260Romain Guy
175b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy#ifndef ANDROID_HWUI_SNAPSHOT_H
185b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy#define ANDROID_HWUI_SNAPSHOT_H
195cbbce535744b89df5ecea95de21ee3733298260Romain Guy
205cbbce535744b89df5ecea95de21ee3733298260Romain Guy#include <GLES2/gl2.h>
215cbbce535744b89df5ecea95de21ee3733298260Romain Guy#include <GLES2/gl2ext.h>
225cbbce535744b89df5ecea95de21ee3733298260Romain Guy
235cbbce535744b89df5ecea95de21ee3733298260Romain Guy#include <utils/RefBase.h>
245b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy#include <ui/Region.h>
255cbbce535744b89df5ecea95de21ee3733298260Romain Guy
26ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy#include <SkRegion.h>
27079ba2c85b15e882629b8d188f5fbdb42f7f8eeaRomain Guy
28dda570201ac851dd85af3861f7e575721d3345daRomain Guy#include "Layer.h"
295cbbce535744b89df5ecea95de21ee3733298260Romain Guy#include "Matrix.h"
305cbbce535744b89df5ecea95de21ee3733298260Romain Guy#include "Rect.h"
315cbbce535744b89df5ecea95de21ee3733298260Romain Guy
325cbbce535744b89df5ecea95de21ee3733298260Romain Guynamespace android {
335cbbce535744b89df5ecea95de21ee3733298260Romain Guynamespace uirenderer {
345cbbce535744b89df5ecea95de21ee3733298260Romain Guy
355cbbce535744b89df5ecea95de21ee3733298260Romain Guy/**
365cbbce535744b89df5ecea95de21ee3733298260Romain Guy * A snapshot holds information about the current state of the rendering
375cbbce535744b89df5ecea95de21ee3733298260Romain Guy * surface. A snapshot is usually created whenever the user calls save()
385cbbce535744b89df5ecea95de21ee3733298260Romain Guy * and discarded when the user calls restore(). Once a snapshot is created,
395cbbce535744b89df5ecea95de21ee3733298260Romain Guy * it can hold information for deferred rendering.
405cbbce535744b89df5ecea95de21ee3733298260Romain Guy *
415cbbce535744b89df5ecea95de21ee3733298260Romain Guy * Each snapshot has a link to a previous snapshot, indicating the previous
425cbbce535744b89df5ecea95de21ee3733298260Romain Guy * state of the renderer.
435cbbce535744b89df5ecea95de21ee3733298260Romain Guy */
445cbbce535744b89df5ecea95de21ee3733298260Romain Guyclass Snapshot: public LightRefBase<Snapshot> {
455cbbce535744b89df5ecea95de21ee3733298260Romain Guypublic:
465cbbce535744b89df5ecea95de21ee3733298260Romain Guy
47ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy    Snapshot();
48ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy    Snapshot(const sp<Snapshot>& s, int saveFlags);
495cbbce535744b89df5ecea95de21ee3733298260Romain Guy
505cbbce535744b89df5ecea95de21ee3733298260Romain Guy    /**
51ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     * Various flags set on ::flags.
525cbbce535744b89df5ecea95de21ee3733298260Romain Guy     */
535cbbce535744b89df5ecea95de21ee3733298260Romain Guy    enum Flags {
545cbbce535744b89df5ecea95de21ee3733298260Romain Guy        /**
555cbbce535744b89df5ecea95de21ee3733298260Romain Guy         * Indicates that the clip region was modified. When this
565cbbce535744b89df5ecea95de21ee3733298260Romain Guy         * snapshot is restored so must the clip.
575cbbce535744b89df5ecea95de21ee3733298260Romain Guy         */
585cbbce535744b89df5ecea95de21ee3733298260Romain Guy        kFlagClipSet = 0x1,
595cbbce535744b89df5ecea95de21ee3733298260Romain Guy        /**
605cbbce535744b89df5ecea95de21ee3733298260Romain Guy         * Indicates that this snapshot was created when saving
615cbbce535744b89df5ecea95de21ee3733298260Romain Guy         * a new layer.
625cbbce535744b89df5ecea95de21ee3733298260Romain Guy         */
63079ba2c85b15e882629b8d188f5fbdb42f7f8eeaRomain Guy        kFlagIsLayer = 0x2,
64f86ef57f8bcd8ba43ce222ec6a8b4f67d3600640Romain Guy        /**
65eb99356a0548684a501766e6a524529ab93304c8Romain Guy         * Indicates that this snapshot is a special type of layer
66eb99356a0548684a501766e6a524529ab93304c8Romain Guy         * backed by an FBO. This flag only makes sense when the
67eb99356a0548684a501766e6a524529ab93304c8Romain Guy         * flag kFlagIsLayer is also set.
68eb99356a0548684a501766e6a524529ab93304c8Romain Guy         */
69eb99356a0548684a501766e6a524529ab93304c8Romain Guy        kFlagIsFboLayer = 0x4,
70eb99356a0548684a501766e6a524529ab93304c8Romain Guy        /**
71eb99356a0548684a501766e6a524529ab93304c8Romain Guy         * Indicates that this snapshot has changed the ortho matrix.
72eb99356a0548684a501766e6a524529ab93304c8Romain Guy         */
73ed7a8fc768df158241819f062a12dafdaf8a628dRomain Guy        kFlagDirtyOrtho = 0x8,
745b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy        /**
755b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy         * Indicates that this snapshot or an ancestor snapshot is
765b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy         * an FBO layer.
775b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy         */
78ed7a8fc768df158241819f062a12dafdaf8a628dRomain Guy        kFlagFboTarget = 0x10
795cbbce535744b89df5ecea95de21ee3733298260Romain Guy    };
805cbbce535744b89df5ecea95de21ee3733298260Romain Guy
815cbbce535744b89df5ecea95de21ee3733298260Romain Guy    /**
82f607bdc167f66b3e7003acaa4736ae46d78c1492Romain Guy     * Modifies the current clip with the new clip rectangle and
83f607bdc167f66b3e7003acaa4736ae46d78c1492Romain Guy     * the specified operation. The specified rectangle is transformed
84f607bdc167f66b3e7003acaa4736ae46d78c1492Romain Guy     * by this snapshot's trasnformation.
853d58c03de0d8877b36cdb78b0ca8b5cac7f600e2Romain Guy     */
86f607bdc167f66b3e7003acaa4736ae46d78c1492Romain Guy    bool clip(float left, float top, float right, float bottom,
87ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy            SkRegion::Op op = SkRegion::kIntersect_Op);
88f607bdc167f66b3e7003acaa4736ae46d78c1492Romain Guy
89f607bdc167f66b3e7003acaa4736ae46d78c1492Romain Guy    /**
90f607bdc167f66b3e7003acaa4736ae46d78c1492Romain Guy     * Modifies the current clip with the new clip rectangle and
91f607bdc167f66b3e7003acaa4736ae46d78c1492Romain Guy     * the specified operation. The specified rectangle is considered
92f607bdc167f66b3e7003acaa4736ae46d78c1492Romain Guy     * already transformed.
93f607bdc167f66b3e7003acaa4736ae46d78c1492Romain Guy     */
94ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy    bool clipTransformed(const Rect& r, SkRegion::Op op = SkRegion::kIntersect_Op);
955cbbce535744b89df5ecea95de21ee3733298260Romain Guy
965cbbce535744b89df5ecea95de21ee3733298260Romain Guy    /**
978ce00301a023eecaeb8891ce906f67b513ebb42aRomain Guy     * Modifies the current clip with the specified region and operation.
988ce00301a023eecaeb8891ce906f67b513ebb42aRomain Guy     * The specified region is considered already transformed.
998ce00301a023eecaeb8891ce906f67b513ebb42aRomain Guy     */
1008ce00301a023eecaeb8891ce906f67b513ebb42aRomain Guy    bool clipRegionTransformed(const SkRegion& region, SkRegion::Op op);
1018ce00301a023eecaeb8891ce906f67b513ebb42aRomain Guy
1028ce00301a023eecaeb8891ce906f67b513ebb42aRomain Guy    /**
103d27977d1a91d5a6b3cc9fa7664ac7e835e7bd895Romain Guy     * Sets the current clip.
104d27977d1a91d5a6b3cc9fa7664ac7e835e7bd895Romain Guy     */
105ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy    void setClip(float left, float top, float right, float bottom);
106959c91f7f7b4f921d341264f5b4ef54e702a0df0Romain Guy
107ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy    /**
108ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     * Returns the current clip in local coordinates. The clip rect is
109ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     * transformed by the inverse transform matrix.
110ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     */
1113f085429fd47ebd32ac2463b3eae2a5a6c17be25Chris Craik    const Rect& getLocalClip();
1123f085429fd47ebd32ac2463b3eae2a5a6c17be25Chris Craik
1133f085429fd47ebd32ac2463b3eae2a5a6c17be25Chris Craik    /**
1143f085429fd47ebd32ac2463b3eae2a5a6c17be25Chris Craik     * Returns the current clip in render target coordinates.
1153f085429fd47ebd32ac2463b3eae2a5a6c17be25Chris Craik     */
1163f085429fd47ebd32ac2463b3eae2a5a6c17be25Chris Craik    const Rect& getRenderTargetClip() { return *clipRect; }
117d27977d1a91d5a6b3cc9fa7664ac7e835e7bd895Romain Guy
118ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy    /**
119ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     * Resets the clip to the specified rect.
120ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     */
121ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy    void resetClip(float left, float top, float right, float bottom);
122eb99356a0548684a501766e6a524529ab93304c8Romain Guy
123ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy    /**
124ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     * Resets the current transform to a pure 3D translation.
125ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     */
126ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy    void resetTransform(float x, float y, float z);
127eb99356a0548684a501766e6a524529ab93304c8Romain Guy
128ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy    /**
129ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     * Indicates whether this snapshot should be ignored. A snapshot
130ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     * is typicalled ignored if its layer is invisible or empty.
131ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     */
132ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy    bool isIgnored() const;
133af636ebf5feb2837683fbfe965040cb706b32ec1Romain Guy
1348b55f377655d13a445b08a0a8ed09b6e95c752b0Romain Guy    /**
135a3dc55f83ab583e0a66b893c71b849afa046770aRomain Guy     * Indicates whether the current transform has perspective components.
136a3dc55f83ab583e0a66b893c71b849afa046770aRomain Guy     */
137a3dc55f83ab583e0a66b893c71b849afa046770aRomain Guy    bool hasPerspectiveTransform() const;
138a3dc55f83ab583e0a66b893c71b849afa046770aRomain Guy
139a3dc55f83ab583e0a66b893c71b849afa046770aRomain Guy    /**
1405cbbce535744b89df5ecea95de21ee3733298260Romain Guy     * Dirty flags.
1415cbbce535744b89df5ecea95de21ee3733298260Romain Guy     */
1425cbbce535744b89df5ecea95de21ee3733298260Romain Guy    int flags;
1435cbbce535744b89df5ecea95de21ee3733298260Romain Guy
1445cbbce535744b89df5ecea95de21ee3733298260Romain Guy    /**
1455cbbce535744b89df5ecea95de21ee3733298260Romain Guy     * Previous snapshot.
1465cbbce535744b89df5ecea95de21ee3733298260Romain Guy     */
1475cbbce535744b89df5ecea95de21ee3733298260Romain Guy    sp<Snapshot> previous;
1485cbbce535744b89df5ecea95de21ee3733298260Romain Guy
1495cbbce535744b89df5ecea95de21ee3733298260Romain Guy    /**
1508ce00301a023eecaeb8891ce906f67b513ebb42aRomain Guy     * A pointer to the currently active layer.
151ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     *
152ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     * This snapshot does not own the layer, this pointer must not be freed.
1535cbbce535744b89df5ecea95de21ee3733298260Romain Guy     */
154dda570201ac851dd85af3861f7e575721d3345daRomain Guy    Layer* layer;
155f86ef57f8bcd8ba43ce222ec6a8b4f67d3600640Romain Guy
1568aef54fa17f2a3753d9a8f2027629bc480088f69Romain Guy    /**
157421458aad764cd9d1403d2540ab979b336b02341Romain Guy     * Target FBO used for rendering. Set to 0 when rendering directly
158421458aad764cd9d1403d2540ab979b336b02341Romain Guy     * into the framebuffer.
159eb99356a0548684a501766e6a524529ab93304c8Romain Guy     */
160eb99356a0548684a501766e6a524529ab93304c8Romain Guy    GLuint fbo;
161eb99356a0548684a501766e6a524529ab93304c8Romain Guy
162eb99356a0548684a501766e6a524529ab93304c8Romain Guy    /**
163dbc26d2ba13f80a7590c57de2d80530d96832969Romain Guy     * Indicates that this snapshot is invisible and nothing should be drawn
164af636ebf5feb2837683fbfe965040cb706b32ec1Romain Guy     * inside it. This flag is set only when the layer clips drawing to its
165af636ebf5feb2837683fbfe965040cb706b32ec1Romain Guy     * bounds and is passed to subsequent snapshots.
166dbc26d2ba13f80a7590c57de2d80530d96832969Romain Guy     */
167dbc26d2ba13f80a7590c57de2d80530d96832969Romain Guy    bool invisible;
168dbc26d2ba13f80a7590c57de2d80530d96832969Romain Guy
169dbc26d2ba13f80a7590c57de2d80530d96832969Romain Guy    /**
170af636ebf5feb2837683fbfe965040cb706b32ec1Romain Guy     * If set to true, the layer will not be composited. This is similar to
171af636ebf5feb2837683fbfe965040cb706b32ec1Romain Guy     * invisible but this flag is not passed to subsequent snapshots.
172af636ebf5feb2837683fbfe965040cb706b32ec1Romain Guy     */
173af636ebf5feb2837683fbfe965040cb706b32ec1Romain Guy    bool empty;
174af636ebf5feb2837683fbfe965040cb706b32ec1Romain Guy
175af636ebf5feb2837683fbfe965040cb706b32ec1Romain Guy    /**
176eb99356a0548684a501766e6a524529ab93304c8Romain Guy     * Current viewport.
177eb99356a0548684a501766e6a524529ab93304c8Romain Guy     */
178eb99356a0548684a501766e6a524529ab93304c8Romain Guy    Rect viewport;
179eb99356a0548684a501766e6a524529ab93304c8Romain Guy
180eb99356a0548684a501766e6a524529ab93304c8Romain Guy    /**
181eb99356a0548684a501766e6a524529ab93304c8Romain Guy     * Height of the framebuffer the snapshot is rendering into.
182eb99356a0548684a501766e6a524529ab93304c8Romain Guy     */
183eb99356a0548684a501766e6a524529ab93304c8Romain Guy    int height;
184eb99356a0548684a501766e6a524529ab93304c8Romain Guy
185eb99356a0548684a501766e6a524529ab93304c8Romain Guy    /**
186eb99356a0548684a501766e6a524529ab93304c8Romain Guy     * Contains the previous ortho matrix.
187eb99356a0548684a501766e6a524529ab93304c8Romain Guy     */
188eb99356a0548684a501766e6a524529ab93304c8Romain Guy    mat4 orthoMatrix;
189eb99356a0548684a501766e6a524529ab93304c8Romain Guy
190eb99356a0548684a501766e6a524529ab93304c8Romain Guy    /**
1918aef54fa17f2a3753d9a8f2027629bc480088f69Romain Guy     * Local transformation. Holds the current translation, scale and
1928aef54fa17f2a3753d9a8f2027629bc480088f69Romain Guy     * rotation values.
193ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     *
194ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     * This is a reference to a matrix owned by this snapshot or another
195ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     *  snapshot. This pointer must not be freed. See ::mTransformRoot.
1968aef54fa17f2a3753d9a8f2027629bc480088f69Romain Guy     */
1978aef54fa17f2a3753d9a8f2027629bc480088f69Romain Guy    mat4* transform;
1988aef54fa17f2a3753d9a8f2027629bc480088f69Romain Guy
1998aef54fa17f2a3753d9a8f2027629bc480088f69Romain Guy    /**
200967e2bf3ac8943a8e8a374bf86021915445cda67Romain Guy     * Current clip rect. The clip is stored in canvas-space coordinates,
2018aef54fa17f2a3753d9a8f2027629bc480088f69Romain Guy     * (screen-space coordinates in the regular case.)
202ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     *
203ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     * This is a reference to a rect owned by this snapshot or another
204ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     * snapshot. This pointer must not be freed. See ::mClipRectRoot.
2058aef54fa17f2a3753d9a8f2027629bc480088f69Romain Guy     */
2068aef54fa17f2a3753d9a8f2027629bc480088f69Romain Guy    Rect* clipRect;
2078aef54fa17f2a3753d9a8f2027629bc480088f69Romain Guy
2085b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy    /**
209967e2bf3ac8943a8e8a374bf86021915445cda67Romain Guy     * Current clip region. The clip is stored in canvas-space coordinates,
210967e2bf3ac8943a8e8a374bf86021915445cda67Romain Guy     * (screen-space coordinates in the regular case.)
211967e2bf3ac8943a8e8a374bf86021915445cda67Romain Guy     *
212967e2bf3ac8943a8e8a374bf86021915445cda67Romain Guy     * This is a reference to a region owned by this snapshot or another
213967e2bf3ac8943a8e8a374bf86021915445cda67Romain Guy     * snapshot. This pointer must not be freed. See ::mClipRegionRoot.
214967e2bf3ac8943a8e8a374bf86021915445cda67Romain Guy     */
2150baaac5e9adf3ee280ae1239e2e58754a9d2b099Romain Guy    SkRegion* clipRegion;
216967e2bf3ac8943a8e8a374bf86021915445cda67Romain Guy
217967e2bf3ac8943a8e8a374bf86021915445cda67Romain Guy    /**
218f219da5e32e85deb442468ee9a63bb28eb198557Romain Guy     * The ancestor layer's dirty region.
219ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     *
220ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     * This is a reference to a region owned by a layer. This pointer must
221ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy     * not be freed.
2225b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy     */
2235b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy    Region* region;
2245b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy
225db8c9a6a4d9bf8c39f834b25611926caf21380f6Chet Haase    /**
226db8c9a6a4d9bf8c39f834b25611926caf21380f6Chet Haase     * Current alpha value. This value is 1 by default, but may be set by a DisplayList which
227db8c9a6a4d9bf8c39f834b25611926caf21380f6Chet Haase     * has translucent rendering in a non-overlapping View. This value will be used by
228db8c9a6a4d9bf8c39f834b25611926caf21380f6Chet Haase     * the renderer to set the alpha in the current color being used for ensuing drawing
229db8c9a6a4d9bf8c39f834b25611926caf21380f6Chet Haase     * operations. The value is inherited by child snapshots because the same value should
230db8c9a6a4d9bf8c39f834b25611926caf21380f6Chet Haase     * be applied to descendents of the current DisplayList (for example, a TextView contains
231db8c9a6a4d9bf8c39f834b25611926caf21380f6Chet Haase     * the base alpha value which should be applied to the child DisplayLists used for drawing
232db8c9a6a4d9bf8c39f834b25611926caf21380f6Chet Haase     * the actual text).
233db8c9a6a4d9bf8c39f834b25611926caf21380f6Chet Haase     */
234db8c9a6a4d9bf8c39f834b25611926caf21380f6Chet Haase    float alpha;
235db8c9a6a4d9bf8c39f834b25611926caf21380f6Chet Haase
2365f803623559aab395a29d575c37c4e39c23a4b4eChris Craik    void dump() const;
2375f803623559aab395a29d575c37c4e39c23a4b4eChris Craik
2385cbbce535744b89df5ecea95de21ee3733298260Romain Guyprivate:
239967e2bf3ac8943a8e8a374bf86021915445cda67Romain Guy    void ensureClipRegion();
240967e2bf3ac8943a8e8a374bf86021915445cda67Romain Guy    void copyClipRectFromRegion();
241967e2bf3ac8943a8e8a374bf86021915445cda67Romain Guy
2420baaac5e9adf3ee280ae1239e2e58754a9d2b099Romain Guy    bool clipRegionOp(float left, float top, float right, float bottom, SkRegion::Op op);
243967e2bf3ac8943a8e8a374bf86021915445cda67Romain Guy
2448aef54fa17f2a3753d9a8f2027629bc480088f69Romain Guy    mat4 mTransformRoot;
2458aef54fa17f2a3753d9a8f2027629bc480088f69Romain Guy    Rect mClipRectRoot;
2463f085429fd47ebd32ac2463b3eae2a5a6c17be25Chris Craik    Rect mLocalClip; // don't use directly, call getLocalClip() which initializes this
247079ba2c85b15e882629b8d188f5fbdb42f7f8eeaRomain Guy
2480baaac5e9adf3ee280ae1239e2e58754a9d2b099Romain Guy    SkRegion mClipRegionRoot;
249967e2bf3ac8943a8e8a374bf86021915445cda67Romain Guy
2505cbbce535744b89df5ecea95de21ee3733298260Romain Guy}; // class Snapshot
2515cbbce535744b89df5ecea95de21ee3733298260Romain Guy
2525cbbce535744b89df5ecea95de21ee3733298260Romain Guy}; // namespace uirenderer
2535cbbce535744b89df5ecea95de21ee3733298260Romain Guy}; // namespace android
2545cbbce535744b89df5ecea95de21ee3733298260Romain Guy
2555b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy#endif // ANDROID_HWUI_SNAPSHOT_H
256