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

Unified Diff: src/gpu/gl/GrGLGpu.h

Issue 1144433002: Move copy-surface-as-draw fallback to GrGLGpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@vares
Patch Set: more Created 5 years, 7 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
Index: src/gpu/gl/GrGLGpu.h
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index 4409b0c8fc9d46106e3642d0587a7b87874c34dd..39615140d70959c67b278d5dfd67ce78a4e68e09 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -101,11 +101,6 @@ public:
const SkIRect& srcRect,
const SkIPoint& dstPoint) override;
- bool canCopySurface(const GrSurface* dst,
- const GrSurface* src,
- const SkIRect& srcRect,
- const SkIPoint& dstPoint) override;
-
void xferBarrier(GrXferBarrierType) override;
void buildProgramDesc(GrProgramDesc*,
@@ -183,6 +178,19 @@ private:
// Subclasses should call this to flush the blend state.
void flushBlend(const GrXferProcessor::BlendInfo& blendInfo);
+ void copySurfaceAsDraw(GrSurface* dst,
+ GrSurface* src,
+ const SkIRect& srcRect,
+ const SkIPoint& dstPoint);
+ void copySurfaceAsCopyTexSubImage(GrSurface* dst,
+ GrSurface* src,
+ const SkIRect& srcRect,
+ const SkIPoint& dstPoint);
+ bool copySurfaceAsBlitFramebuffer(GrSurface* dst,
+ GrSurface* src,
+ const SkIRect& srcRect,
+ const SkIPoint& dstPoint);
+
bool hasExtension(const char* ext) const { return fGLContext.hasExtension(ext); }
static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff);
@@ -294,6 +302,8 @@ private:
void unbindTextureFromFBO(GrGLenum fboTarget);
+ void createCopyProgram();
+
GrGLContext fGLContext;
// GL program-related state
@@ -420,7 +430,17 @@ private:
const GrGLVertexBuffer* vbuffer,
const GrGLIndexBuffer* ibuffer);
+ /** Variants of the above that takes GL buffer IDs. Note that 0 does not imply that a
+ buffer won't be bound. The "default buffer" will be bound, which is used for client-side
+ array rendering. */
+ GrGLAttribArrayState* bindArrayAndBufferToDraw(GrGLGpu* gpu, GrGLuint vbufferID);
+ GrGLAttribArrayState* bindArrayAndBuffersToDraw(GrGLGpu* gpu,
+ GrGLuint vbufferID,
+ GrGLuint ibufferID);
+
private:
+ GrGLAttribArrayState* internalBind(GrGLGpu* gpu, GrGLuint vbufferID, GrGLuint* ibufferID);
+
GrGLuint fBoundVertexArrayID;
GrGLuint fBoundVertexBufferID;
bool fBoundVertexArrayIDIsValid;
@@ -454,6 +474,15 @@ private:
}
} fHWBlendState;
+ /** IDs for copy surface program. */
+ struct {
+ GrGLuint fProgram;
+ GrGLint fTextureUniform;
+ GrGLint fTexCoordXformUniform;
+ GrGLint fPosXformUniform;
+ GrGLuint fArrayBuffer;
+ } fCopyProgram;
+
TriState fMSAAEnabled;
GrStencilSettings fHWStencilSettings;
« no previous file with comments | « src/gpu/GrTest.cpp ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | src/gpu/gl/GrGLGpu.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698