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

Unified Diff: src/image/SkImage_Gpu.cpp

Issue 150513005: impl getROPixels for gpu SkImage (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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 | « bench/benchmain.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Gpu.cpp
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index ab0a5237fd3eadc5a87f21c29d5150559fa10daa..0d8ddaa6018861434e150e288457795e1478a54c 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -23,10 +23,7 @@ public:
virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) SK_OVERRIDE;
virtual void onDrawRectToRect(SkCanvas*, const SkRect* src, const SkRect& dst, const SkPaint*) SK_OVERRIDE;
virtual GrTexture* onGetTexture() SK_OVERRIDE;
- virtual bool getROPixels(SkBitmap*) const SK_OVERRIDE {
- // TODO
- return false;
- }
+ virtual bool getROPixels(SkBitmap*) const SK_OVERRIDE;
GrTexture* getTexture() { return fBitmap.getTexture(); }
@@ -61,6 +58,10 @@ GrTexture* SkImage_Gpu::onGetTexture() {
return fBitmap.getTexture();
}
+bool SkImage_Gpu::getROPixels(SkBitmap* dst) const {
+ return fBitmap.copyTo(dst, SkBitmap::kARGB_8888_Config);
+}
+
///////////////////////////////////////////////////////////////////////////////
SkImage* SkImage::NewTexture(const SkBitmap& bitmap) {
« no previous file with comments | « bench/benchmain.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698