Make flush discardable and lazily reset context
Review URL: http://codereview.appspot.com/4259059/
git-svn-id: http://skia.googlecode.com/svn/trunk@914 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrGpuGL.h b/gpu/src/GrGpuGL.h
index a2905c5..ab504ad 100644
--- a/gpu/src/GrGpuGL.h
+++ b/gpu/src/GrGpuGL.h
@@ -31,28 +31,6 @@
GrGpuGL();
virtual ~GrGpuGL();
- // overrides from GrGpu
- virtual void resetContext();
-
- virtual GrTexture* createTexture(const TextureDesc& desc,
- const void* srcData, size_t rowBytes);
- virtual GrVertexBuffer* createVertexBuffer(uint32_t size, bool dynamic);
- virtual GrIndexBuffer* createIndexBuffer(uint32_t size, bool dynamic);
-
- virtual GrRenderTarget* createPlatformRenderTarget(
- intptr_t platformRenderTarget,
- int stencilBits,
- int width, int height);
-
- virtual GrRenderTarget* createRenderTargetFrom3DApiState();
-
- virtual void eraseColor(GrColor color);
-
- virtual void forceRenderTargetFlush();
-
- virtual bool readPixels(int left, int top, int width, int height,
- GrTexture::PixelConfig, void* buffer);
-
/**
* Gets the struct containing the GL extensions for the context
* underlying the GrGpuGL
@@ -97,6 +75,31 @@
GrGLExts fExts;
// GrGpu overrides
+ // overrides from GrGpu
+ virtual void resetContext();
+
+ virtual GrTexture* createTextureHelper(const TextureDesc& desc,
+ const void* srcData,
+ size_t rowBytes);
+ virtual GrVertexBuffer* createVertexBufferHelper(uint32_t size,
+ bool dynamic);
+ virtual GrIndexBuffer* createIndexBufferHelper(uint32_t size,
+ bool dynamic);
+
+ virtual GrRenderTarget* createPlatformRenderTargetHelper(
+ intptr_t platformRenderTarget,
+ int stencilBits,
+ int width, int height);
+
+ virtual GrRenderTarget* createRenderTargetFrom3DApiStateHelper();
+
+ virtual void eraseColorHelper(GrColor color);
+
+ virtual void forceRenderTargetFlushHelper();
+
+ virtual bool readPixelsHelper(int left, int top, int width, int height,
+ GrTexture::PixelConfig, void* buffer);
+
virtual void drawIndexedHelper(GrPrimitiveType type,
uint32_t startVertex,
uint32_t startIndex,
@@ -140,8 +143,6 @@
const GrSamplerState& sampler);
private:
- void resetContextHelper();
-
// notify callbacks to update state tracking when related
// objects are bound to GL or deleted outside of the class
void notifyVertexBufferBind(const GrGLVertexBuffer* buffer);
@@ -190,4 +191,4 @@
typedef GrGpu INHERITED;
};
-#endif
\ No newline at end of file
+#endif