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

Unified Diff: src/image/SkImage_Raster.cpp

Issue 1301373007: add preroll to image, for chrome's warmup pass (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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/image/SkImage_Base.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Raster.cpp
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp
index 015f98a646b37368b881ccde46a833de0311f91d..af8f79010f134047b0ebf25678f9a22364dcb0d3 100644
--- a/src/image/SkImage_Raster.cpp
+++ b/src/image/SkImage_Raster.cpp
@@ -64,6 +64,7 @@ public:
SkSurface* onNewSurface(const SkImageInfo&, const SkSurfaceProps&) const override;
bool onReadPixels(const SkImageInfo&, void*, size_t, int srcX, int srcY) const override;
+ void onPreroll(GrContext*) const override;
const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const override;
SkData* onRefEncoded() const override;
bool getROPixels(SkBitmap*) const override;
@@ -163,6 +164,11 @@ const void* SkImage_Raster::onPeekPixels(SkImageInfo* infoPtr, size_t* rowBytesP
return fBitmap.getPixels();
}
+void SkImage_Raster::onPreroll(GrContext* ctx) const {
+ fBitmap.lockPixels();
+ fBitmap.unlockPixels();
+}
+
SkData* SkImage_Raster::onRefEncoded() const {
SkPixelRef* pr = fBitmap.pixelRef();
const SkImageInfo prInfo = pr->info();
« no previous file with comments | « src/image/SkImage_Base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698