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

Unified Diff: src/image/SkImage_Raster.cpp

Issue 855473002: initial preroll api (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 1dd57d6dc21c26d28d7c9218afb267e84977258a..940d5323789d6c01eb6051834ae6dbb59f386897 100644
--- a/src/image/SkImage_Raster.cpp
+++ b/src/image/SkImage_Raster.cpp
@@ -58,6 +58,7 @@ public:
bool onReadPixels(const SkImageInfo&, void*, size_t, int srcX, int srcY) const SK_OVERRIDE;
const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const SK_OVERRIDE;
bool getROPixels(SkBitmap*) const SK_OVERRIDE;
+ void onPreroll() const SK_OVERRIDE;
// exposed for SkSurface_Raster via SkNewImageFromPixelRef
SkImage_Raster(const SkImageInfo&, SkPixelRef*, size_t rowBytes, const SkSurfaceProps*);
@@ -154,6 +155,12 @@ bool SkImage_Raster::getROPixels(SkBitmap* dst) const {
return true;
}
+void SkImage_Raster::onPreroll() const {
+ SkBitmap bm(fBitmap);
+ bm.lockPixels();
+ bm.unlockPixels();
+}
+
///////////////////////////////////////////////////////////////////////////////
SkImage* SkImage::NewRasterCopy(const SkImageInfo& info, const void* pixels, size_t rowBytes) {
@@ -208,3 +215,4 @@ const SkPixelRef* SkBitmapImageGetPixelRef(const SkImage* image) {
bool SkImage_Raster::isOpaque() const {
return fBitmap.isOpaque();
}
+
« 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