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

Unified Diff: src/image/SkImage_Gpu.h

Issue 2337803002: Don't copy image buffer when calculating size.
Patch Set: When no CPU work is needed, returning 0 means test expectation is false (0 == false). Created 4 years, 1 month 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/image/SkImage_Gpu.h
diff --git a/src/image/SkImage_Gpu.h b/src/image/SkImage_Gpu.h
index 13c1e306dc93b95b66ac4611733a90371354f547..1d0c7e990f5bc12789006134e46b91ca000442b5 100644
--- a/src/image/SkImage_Gpu.h
+++ b/src/image/SkImage_Gpu.h
@@ -50,6 +50,15 @@ public:
}
bool onReadPixels(const SkImageInfo&, void* dstPixels, size_t dstRowBytes,
int srcX, int srcY, CachingHint) const override;
+#if SK_SUPPORT_GPU
+ bool canGenerateTexture(const GrContextThreadSafeProxy& proxy) const override
+ {
+ if (fTexture) {
+ return fTexture->getContext()->uniqueID() == proxy.uniqueID();
+ }
+ return false;
+ }
+#endif
cblume 2016/11/16 01:07:16 This might be a tad large for being in the .h -- s
private:
sk_sp<GrTexture> fTexture;

Powered by Google App Engine
This is Rietveld 408576698