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

Unified Diff: src/core/SkDevice.cpp

Issue 1155443004: change internals over to SkPixmap and stop using accessBitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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 37fafd8dfb19f8dd285b610cb7f5442409ee0348..14784a25d657bf9b1c9f862a274b28ecd8128407 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -91,10 +91,6 @@ void SkBaseDevice::initForRootLayer(SkPixelGeometry geo) {
geo));
}
-SkSurface* SkBaseDevice::newSurface(const SkImageInfo&, const SkSurfaceProps&) { return NULL; }
-
-const void* SkBaseDevice::peekPixels(SkImageInfo*, size_t*) { return NULL; }
-
void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer,
const SkRRect& inner, const SkPaint& paint) {
SkPath path;
@@ -221,28 +217,28 @@ bool SkBaseDevice::onReadPixels(const SkImageInfo&, void*, size_t, int x, int y)
return false;
}
-void* SkBaseDevice::accessPixels(SkImageInfo* info, size_t* rowBytes) {
- SkImageInfo tmpInfo;
- size_t tmpRowBytes;
- if (NULL == info) {
- info = &tmpInfo;
- }
- if (NULL == rowBytes) {
- rowBytes = &tmpRowBytes;
- }
- return this->onAccessPixels(info, rowBytes);
-}
-
-void* SkBaseDevice::onAccessPixels(SkImageInfo* info, size_t* rowBytes) {
- return NULL;
-}
-
bool SkBaseDevice::EXPERIMENTAL_drawPicture(SkCanvas*, const SkPicture*, const SkMatrix*,
const SkPaint*) {
// The base class doesn't perform any accelerated picture rendering
return false;
}
+bool SkBaseDevice::accessPixels(SkPixmap* pmap) {
+ SkPixmap tempStorage;
+ if (NULL == pmap) {
+ pmap = &tempStorage;
+ }
+ return this->onAccessPixels(pmap);
+}
+
+bool SkBaseDevice::peekPixels(SkPixmap* pmap) {
+ SkPixmap tempStorage;
+ if (NULL == pmap) {
+ pmap = &tempStorage;
+ }
+ return this->onPeekPixels(pmap);
+}
+
//////////////////////////////////////////////////////////////////////////////////////////
static void morphpoints(SkPoint dst[], const SkPoint src[], int count,
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkPictureRecord.h » ('j') | src/core/SkPixmap.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698