Loading libs/hwui/DisplayListOp.h +0 −1 Original line number Diff line number Diff line Loading @@ -594,7 +594,6 @@ public: private: SkRegion* mRegion; SkRegion::Op mOp; }; class ResetShaderOp : public StateOp { Loading libs/hwui/OpenGLRenderer.cpp +9 −5 Original line number Diff line number Diff line Loading @@ -1668,7 +1668,7 @@ bool OpenGLRenderer::clipRect(float left, float top, float right, float bottom, SkPath path; path.addRect(left, top, right, bottom); return clipPath(&path, op); return OpenGLRenderer::clipPath(&path, op); } bool OpenGLRenderer::clipPath(SkPath* path, SkRegion::Op op) { Loading @@ -1679,12 +1679,16 @@ bool OpenGLRenderer::clipPath(SkPath* path, SkRegion::Op op) { path->transform(transform, &transformed); SkRegion clip; if (!mSnapshot->clipRegion->isEmpty()) { clip.setRegion(*mSnapshot->clipRegion); if (!mSnapshot->previous->clipRegion->isEmpty()) { clip.setRegion(*mSnapshot->previous->clipRegion); } else { if (mSnapshot->previous == mFirstSnapshot) { clip.setRect(0, 0, mWidth, mHeight); } else { Rect* bounds = mSnapshot->clipRect; Rect* bounds = mSnapshot->previous->clipRect; clip.setRect(bounds->left, bounds->top, bounds->right, bounds->bottom); } } SkRegion region; region.setPath(transformed, clip); Loading libs/hwui/Stencil.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ * limitations under the License. */ #include "Debug.h" #include "Extensions.h" #include "Properties.h" #include "Stencil.h" Loading tests/HwAccelerationTest/src/com/android/test/hwui/ClipRegion2Activity.java +2 −4 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ public class ClipRegion2Activity extends Activity { } public static class RegionView extends FrameLayout { private final Region mRegion = new Region(); private Region mRegion = new Region(); private float mClipPosition = 0.0f; public RegionView(Context c) { Loading @@ -69,9 +69,7 @@ public class ClipRegion2Activity extends Activity { canvas.save(); mRegion.setEmpty(); mRegion.op(0, 0, getWidth(), getHeight(), Region.Op.REPLACE); mRegion.set(0, 0, getWidth(), getHeight()); mRegion.op(getWidth() / 4, getHeight() / 4, 3 * getWidth() / 4, 3 * getHeight() / 4, Region.Op.DIFFERENCE); Loading Loading
libs/hwui/DisplayListOp.h +0 −1 Original line number Diff line number Diff line Loading @@ -594,7 +594,6 @@ public: private: SkRegion* mRegion; SkRegion::Op mOp; }; class ResetShaderOp : public StateOp { Loading
libs/hwui/OpenGLRenderer.cpp +9 −5 Original line number Diff line number Diff line Loading @@ -1668,7 +1668,7 @@ bool OpenGLRenderer::clipRect(float left, float top, float right, float bottom, SkPath path; path.addRect(left, top, right, bottom); return clipPath(&path, op); return OpenGLRenderer::clipPath(&path, op); } bool OpenGLRenderer::clipPath(SkPath* path, SkRegion::Op op) { Loading @@ -1679,12 +1679,16 @@ bool OpenGLRenderer::clipPath(SkPath* path, SkRegion::Op op) { path->transform(transform, &transformed); SkRegion clip; if (!mSnapshot->clipRegion->isEmpty()) { clip.setRegion(*mSnapshot->clipRegion); if (!mSnapshot->previous->clipRegion->isEmpty()) { clip.setRegion(*mSnapshot->previous->clipRegion); } else { if (mSnapshot->previous == mFirstSnapshot) { clip.setRect(0, 0, mWidth, mHeight); } else { Rect* bounds = mSnapshot->clipRect; Rect* bounds = mSnapshot->previous->clipRect; clip.setRect(bounds->left, bounds->top, bounds->right, bounds->bottom); } } SkRegion region; region.setPath(transformed, clip); Loading
libs/hwui/Stencil.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ * limitations under the License. */ #include "Debug.h" #include "Extensions.h" #include "Properties.h" #include "Stencil.h" Loading
tests/HwAccelerationTest/src/com/android/test/hwui/ClipRegion2Activity.java +2 −4 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ public class ClipRegion2Activity extends Activity { } public static class RegionView extends FrameLayout { private final Region mRegion = new Region(); private Region mRegion = new Region(); private float mClipPosition = 0.0f; public RegionView(Context c) { Loading @@ -69,9 +69,7 @@ public class ClipRegion2Activity extends Activity { canvas.save(); mRegion.setEmpty(); mRegion.op(0, 0, getWidth(), getHeight(), Region.Op.REPLACE); mRegion.set(0, 0, getWidth(), getHeight()); mRegion.op(getWidth() / 4, getHeight() / 4, 3 * getWidth() / 4, 3 * getHeight() / 4, Region.Op.DIFFERENCE); Loading