Merge "Fix the system"

This commit is contained in:
Romain Guy
2012-02-07 18:22:43 -08:00
committed by Android (Google) Code Review

View File

@@ -43,6 +43,8 @@ Snapshot::Snapshot(const sp<Snapshot>& s, int saveFlags):
invisible(s->invisible), empty(false), invisible(s->invisible), empty(false),
viewport(s->viewport), height(s->height) { viewport(s->viewport), height(s->height) {
clipRegion = NULL;
if (saveFlags & SkCanvas::kMatrix_SaveFlag) { if (saveFlags & SkCanvas::kMatrix_SaveFlag) {
mTransformRoot.load(*s->transform); mTransformRoot.load(*s->transform);
transform = &mTransformRoot; transform = &mTransformRoot;
@@ -57,11 +59,7 @@ Snapshot::Snapshot(const sp<Snapshot>& s, int saveFlags):
if (s->clipRegion) { if (s->clipRegion) {
mClipRegionRoot.merge(*s->clipRegion); mClipRegionRoot.merge(*s->clipRegion);
clipRegion = &mClipRegionRoot; clipRegion = &mClipRegionRoot;
} else {
clipRegion = NULL;
} }
#else
clipRegion = NULL;
#endif #endif
} else { } else {
clipRect = s->clipRect; clipRect = s->clipRect;
@@ -213,10 +211,12 @@ bool Snapshot::clipTransformed(const Rect& r, SkRegion::Op op) {
void Snapshot::setClip(float left, float top, float right, float bottom) { void Snapshot::setClip(float left, float top, float right, float bottom) {
clipRect->set(left, top, right, bottom); clipRect->set(left, top, right, bottom);
#if STENCIL_BUFFER_SIZE
if (clipRegion) { if (clipRegion) {
clipRegion->clear(); clipRegion->clear();
clipRegion = NULL; clipRegion = NULL;
} }
#endif
flags |= Snapshot::kFlagClipSet; flags |= Snapshot::kFlagClipSet;
} }