move some copy surface stuff to GrFlushToGpuDrawTarget
authorbsalomon <bsalomon@google.com>
Tue, 2 Dec 2014 17:40:12 +0000 (09:40 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 2 Dec 2014 17:40:12 +0000 (09:40 -0800)
Review URL: https://codereview.chromium.org/770813002

src/gpu/GrFlushToGpuDrawTarget.cpp
src/gpu/GrFlushToGpuDrawTarget.h
src/gpu/GrInOrderDrawBuffer.cpp
src/gpu/GrInOrderDrawBuffer.h

index b860468..7007625 100644 (file)
@@ -249,3 +249,14 @@ void GrFlushToGpuDrawTarget::geometrySourceWillPop(const GeometrySrcState& resto
         poolState.fUsedPoolIndexBytes = sizeof(uint16_t) * restoredState.fIndexCount;
     }
 }
+
+bool GrFlushToGpuDrawTarget::onCanCopySurface(const GrSurface* dst,
+                                              const GrSurface* src,
+                                              const SkIRect& srcRect,
+                                              const SkIPoint& dstPoint) {
+    return getGpu()->canCopySurface(dst, src, srcRect, dstPoint);
+}
+
+bool GrFlushToGpuDrawTarget::onInitCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) {
+    return getGpu()->initCopySurfaceDstDesc(src, desc);
+}
index f3f34b0..2383c62 100644 (file)
@@ -79,6 +79,11 @@ private:
     void willReserveVertexAndIndexSpace(int vertexCount,
                                         size_t vertexStride,
                                         int indexCount) SK_OVERRIDE;
+    bool onCanCopySurface(const GrSurface* dst,
+                          const GrSurface* src,
+                          const SkIRect& srcRect,
+                          const SkIPoint& dstPoint) SK_OVERRIDE;
+    bool onInitCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) SK_OVERRIDE;
 
     GeoPoolStateStack                   fGeoPoolStateStack;
     SkAutoTUnref<GrGpu>                 fGpu;
index 8a136cd..6b98e13 100644 (file)
@@ -481,17 +481,6 @@ bool GrInOrderDrawBuffer::onCopySurface(GrSurface* dst,
     return false;
 }
 
-bool GrInOrderDrawBuffer::onCanCopySurface(const GrSurface* dst,
-                                         const GrSurface* src,
-                                         const SkIRect& srcRect,
-                                         const SkIPoint& dstPoint) {
-    return getGpu()->canCopySurface(dst, src, srcRect, dstPoint);
-}
-
-bool GrInOrderDrawBuffer::onInitCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) {
-    return getGpu()->initCopySurfaceDstDesc(src, desc);
-}
-
 bool GrInOrderDrawBuffer::recordStateAndShouldDraw(const GrDrawState& ds,
                                                    GrGpu::DrawType drawType,
                                                    const GrClipMaskManager::ScissorState& scissor,
index 207f88e..532842a 100644 (file)
@@ -225,11 +225,6 @@ private:
                        GrSurface* src,
                        const SkIRect& srcRect,
                        const SkIPoint& dstPoint) SK_OVERRIDE;
-    bool onCanCopySurface(const GrSurface* dst,
-                          const GrSurface* src,
-                          const SkIRect& srcRect,
-                          const SkIPoint& dstPoint) SK_OVERRIDE;
-    bool onInitCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) SK_OVERRIDE;
 
     // Attempts to concat instances from info onto the previous draw. info must represent an
     // instanced draw. The caller must have already recorded a new draw state and clip if necessary.