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

Unified Diff: include/core/SkCanvas.h

Issue 1550583002: remove unused SkAutoROCanvasPixels (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 | « gm/xfermodes3.cpp ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 854611aec18a1206a2ed1f4b7e7e9b65a2b450dc..d36b9918e45e68eb40df47c743e36f5dc864b262 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -1554,49 +1554,6 @@ private:
};
#define SkAutoCanvasRestore(...) SK_REQUIRE_LOCAL_VAR(SkAutoCanvasRestore)
-/**
- * If the caller wants read-only access to the pixels in a canvas, it can just
- * call canvas->peekPixels(), since that is the fastest way to "peek" at the
- * pixels on a raster-backed canvas.
- *
- * If the canvas has pixels, but they are not readily available to the CPU
- * (e.g. gpu-backed), then peekPixels() will fail, but readPixels() will
- * succeed (though be slower, since it will return a copy of the pixels).
- *
- * SkAutoROCanvasPixels encapsulates these two techniques, trying first to call
- * peekPixels() (for performance), but if that fails, calling readPixels() and
- * storing the copy locally.
- *
- * The caller must respect the restrictions associated with peekPixels(), since
- * that may have been called: The returned information is invalidated if...
- * - any API is called on the canvas (or its parent surface if present)
- * - the canvas goes out of scope
- */
-class SkAutoROCanvasPixels : SkNoncopyable {
-public:
- SkAutoROCanvasPixels(SkCanvas* canvas);
-
- // returns NULL on failure
- const void* addr() const { return fAddr; }
-
- // undefined if addr() == NULL
- size_t rowBytes() const { return fRowBytes; }
-
- // undefined if addr() == NULL
- const SkImageInfo& info() const { return fInfo; }
-
- // helper that, if returns true, installs the pixels into the bitmap. Note
- // that the bitmap may reference the address returned by peekPixels(), so
- // the caller must respect the restrictions associated with peekPixels().
- bool asROBitmap(SkBitmap*) const;
-
-private:
- SkBitmap fBitmap; // used if peekPixels() fails
- const void* fAddr; // NULL on failure
- SkImageInfo fInfo;
- size_t fRowBytes;
-};
-
#ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
static inline SkCanvas::SaveFlags operator|(const SkCanvas::SaveFlags lhs,
const SkCanvas::SaveFlags rhs) {
« no previous file with comments | « gm/xfermodes3.cpp ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698