Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1070)

Unified Diff: src/gpu/GrLayerHoister.cpp

Issue 549143003: Fix bug in layer hoisting transition to SkRecord backend (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrLayerHoister.cpp
diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp
index ac09df825b4ebe5ab7b26b7322ab3bf22225bcda..f3c11262fc3254839ed558f6d2aac2be20e46776 100644
--- a/src/gpu/GrLayerHoister.cpp
+++ b/src/gpu/GrLayerHoister.cpp
@@ -91,11 +91,18 @@ void GrLayerHoister::DrawLayers(const SkPicture* picture,
// info.fCTM maps the layer's top/left to the origin.
// Since this layer is atlased, the top/left corner needs
// to be offset to the correct location in the backing texture.
+ SkMatrix initialCTM;
+ initialCTM.setTranslate(SkIntToScalar(-layer->offset().fX),
+ SkIntToScalar(-layer->offset().fY));
+ initialCTM.postTranslate(bound.fLeft, bound.fTop);
+
+ atlasCanvas->translate(SkIntToScalar(-layer->offset().fX),
+ SkIntToScalar(-layer->offset().fY));
atlasCanvas->translate(bound.fLeft, bound.fTop);
atlasCanvas->concat(layer->ctm());
SkRecordPartialDraw(*picture->fRecord.get(), atlasCanvas, bound,
- layer->start(), layer->stop());
+ layer->start(), layer->stop(), initialCTM);
atlasCanvas->restore();
}
@@ -126,10 +133,16 @@ void GrLayerHoister::DrawLayers(const SkPicture* picture,
layerCanvas->clear(SK_ColorTRANSPARENT);
+ SkMatrix initialCTM;
+ initialCTM.setTranslate(SkIntToScalar(-layer->offset().fX),
+ SkIntToScalar(-layer->offset().fY));
+
+ layerCanvas->translate(SkIntToScalar(-layer->offset().fX),
+ SkIntToScalar(-layer->offset().fY));
layerCanvas->concat(layer->ctm());
SkRecordPartialDraw(*picture->fRecord.get(), layerCanvas, bound,
- layer->start(), layer->stop());
+ layer->start(), layer->stop(), initialCTM);
layerCanvas->flush();
}
@@ -151,6 +164,7 @@ void GrLayerHoister::UnlockLayers(GrLayerCache* layerCache, const SkPicture* pic
GrCachedLayer* layer = layerCache->findLayer(picture->uniqueID(),
info.fSaveLayerOpID,
info.fRestoreOpID,
+ info.fOffset,
info.fOriginXform);
layerCache->unlock(layer);
}

Powered by Google App Engine
This is Rietveld 408576698