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

Unified Diff: src/core/SkDevice.cpp

Issue 159723006: add peekPixels to canvas (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
Index: src/core/SkDevice.cpp
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index 9ce8b6b5df2e2a002bbd7fee9d5836df557c244d..4bf8516fd7a1dca231d5f97675e0fc71d5a4b0bc 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -65,6 +65,16 @@ SkMetaData& SkBaseDevice::getMetaData() {
return *fMetaData;
}
+// TODO: when we can remove width/height/config from SkBaseDevice, then other
+// classes should explicitly override this guy.
+SkImageInfo SkBaseDevice::imageInfo() const {
+ return SkImageInfo::Make(this->width(),
+ this->height(),
+ SkBitmapConfigToColorType(this->config()),
+ this->isOpaque() ? kOpaque_SkAlphaType :
+ kPremul_SkAlphaType);
+}
+
const SkBitmap& SkBaseDevice::accessBitmap(bool changePixels) {
const SkBitmap& bitmap = this->onAccessBitmap();
if (changePixels) {
@@ -117,3 +127,5 @@ bool SkBaseDevice::readPixels(SkBitmap* bitmap, int x, int y,
}
SkSurface* SkBaseDevice::newSurface(const SkImageInfo&) { return NULL; }
+
+const void* SkBaseDevice::peekPixels(SkImageInfo*, size_t*) { return NULL; }

Powered by Google App Engine
This is Rietveld 408576698