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

Unified Diff: src/gpu/GrGpu.h

Issue 749903003: some cleanup around GrGpu/GrDrawTarget copySurface (Closed) Base URL: https://skia.googlesource.com/skia.git@isSameAs
Patch Set: fix regression Created 6 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
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpu.h
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index b10a63f2dff2597bd81a4c623f77cbbdb205d72d..d0bff30262c59a220af6dcea2ab25f87d89c1e52 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -278,10 +278,11 @@ public:
/**
* This is can be called before allocating a texture to be a dst for copySurface. It will
- * populate the origin, config, and flags fields of the desc such that copySurface is more
- * likely to succeed and be efficient.
+ * populate the origin, config, and flags fields of the desc such that copySurface can
+ * efficiently succeed. It should only succeed if it can allow copySurface to perform a copy
+ * that would be more effecient than drawing the src to a dst render target.
*/
- virtual void initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc);
+ virtual bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) = 0;
// After the client interacts directly with the 3D context state the GrGpu
// must resync its internal state and assumptions about 3D context state.
@@ -337,20 +338,20 @@ public:
void saveActiveTraceMarkers();
void restoreActiveTraceMarkers();
- // Called to determine whether an onCopySurface call would succeed or not. This is useful for
- // proxy subclasses to test whether the copy would succeed without executing it yet. Derived
- // classes must keep this consistent with their implementation of onCopySurface(). The inputs
- // are the same as onCopySurface(), i.e. srcRect and dstPoint are clipped to be inside the src
- // and dst bounds.
+ // Called to determine whether a copySurface call would succeed or not. Derived
+ // classes must keep this consistent with their implementation of onCopySurface(). Fallbacks
+ // to issuing a draw from the src to dst take place at the GrDrawTarget level and this function
+ // should only return true if a faster copy path exists. The rect and point are pre-clipped. The
+ // src rect and implied dst rect are guaranteed to be within the src/dst bounds and non-empty.
virtual bool canCopySurface(const GrSurface* dst,
const GrSurface* src,
const SkIRect& srcRect,
const SkIPoint& dstPoint) = 0;
- // This method is called by copySurface The srcRect is guaranteed to be entirely within the
- // src bounds. Likewise, the dst rect implied by dstPoint and srcRect's width and height falls
- // entirely within the dst. The default implementation will draw a rect from the src to the
- // dst if the src is a texture and the dst is a render target and fail otherwise.
+ // Called to perform a surface to surface copy. Fallbacks to issuing a draw from the src to dst
+ // take place at the GrDrawTarget level and this function implement faster copy paths. The rect
+ // and point are pre-clipped. The src rect and implied dst rect are guaranteed to be within the
+ // src/dst bounds and non-empty.
virtual bool copySurface(GrSurface* dst,
GrSurface* src,
const SkIRect& srcRect,
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698