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

Unified Diff: src/core/SkSpecialImage.h

Issue 1861643003: Upgrade SkSpecialImage to have getTextureRef & getROPixels entry points (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address code review comments Created 4 years, 8 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/core/SkImageFilter.cpp ('k') | src/core/SkSpecialImage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkSpecialImage.h
diff --git a/src/core/SkSpecialImage.h b/src/core/SkSpecialImage.h
index 57785fa4459d9c46dedb05c3b5bd0df606e72cca..2aa5bc6854d57824ffabd12008d7ed5840ae1060 100644
--- a/src/core/SkSpecialImage.h
+++ b/src/core/SkSpecialImage.h
@@ -123,24 +123,29 @@ public:
// TODO: hide this when GrLayerHoister uses SkSpecialImages more fully (see skbug.com/5063)
/**
- * If the SpecialImage is backed by a gpu texture, return that texture.
+ * If the SpecialImage is backed by a gpu texture, return true.
+ */
+ bool isTextureBacked() const;
+
+ /**
+ * Return the GrContext if the SkSpecialImage is GrTexture-backed
+ */
+ GrContext* getContext() const;
+
+ /**
+ * Regardless of the underlying backing store, return the contents as a GrTexture.
* The active portion of the texture can be retrieved via 'subset'.
*/
- GrTexture* peekTexture() const;
+ GrTexture* asTextureRef(GrContext*) const;
// TODO: hide this whe the imagefilter all have a consistent draw path (see skbug.com/5063)
/**
- * If the SpecialImage is backed by cpu pixels, return the const address
- * of those pixels and, if not null, the ImageInfo, rowBytes, and, if present,
- * the color table. The returned address(es) is/are only valid while the image object
- * is in scope.
+ * Regardless of the underlying backing store, return the contents as an SkBitmap
*
* The returned ImageInfo represents the backing memory. Use 'subset'
* to get the active portion's dimensions.
- *
- * On failure, return false and ignore the pixmap parameter.
*/
- bool peekPixels(SkPixmap*) const;
+ bool getROPixels(SkBitmap*) const;
protected:
SkSpecialImage(SkImageFilter::Proxy*, const SkIRect& subset, uint32_t uniqueID,
@@ -150,10 +155,6 @@ protected:
friend class TestingSpecialImageAccess;
friend class TestingSpecialSurfaceAccess;
- // This entry point is for testing only. It does a readback from VRAM for
- // GPU-backed special images.
- bool testingOnlyGetROPixels(SkBitmap*) const;
-
// TODO: remove this ASAP (see skbug.com/4965)
SkImageFilter::Proxy* proxy() const { return fProxy; }
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/core/SkSpecialImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698