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

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: Update to ToT 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
« no previous file with comments | « src/gpu/GrLayerCache.cpp ('k') | src/gpu/GrPictureUtils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrLayerHoister.cpp
diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp
index 49ca338bb2527bfd2f4bf4bd9fed5e756d42ebd8..a29d91ac9d3ec95fa295fd908d8335f0b6847468 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()+1, layer->stop());
+ layer->start()+1, 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()+1, layer->stop());
+ layer->start()+1, 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);
}
« no previous file with comments | « src/gpu/GrLayerCache.cpp ('k') | src/gpu/GrPictureUtils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698