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

Unified Diff: src/image/SkImage.cpp

Issue 1341043002: impl preroll for all image backends (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « no previous file | src/image/SkImage_Base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage.cpp
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp
index 4315ad7e87fcd56245c8458415f0d11223723d0d..654b848fce22073ba274c57cbe0768c3464093dc 100644
--- a/src/image/SkImage.cpp
+++ b/src/image/SkImage.cpp
@@ -55,7 +55,14 @@ bool SkImage::readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dst
}
void SkImage::preroll(GrContext* ctx) const {
- as_IB(this)->onPreroll(ctx);
+ // For now, and to maintain parity w/ previous pixelref behavior, we just force the image
+ // to produce a cached raster-bitmap form, so that drawing to a raster canvas should be fast.
+ //
+ SkBitmap bm;
+ if (as_IB(this)->getROPixels(&bm)) {
+ bm.lockPixels();
+ bm.unlockPixels();
+ }
}
SkShader* SkImage::newShader(SkShader::TileMode tileX,
« no previous file with comments | « no previous file | src/image/SkImage_Base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698