Index: src/gpu/gl/GrGLGpu.h |
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h |
index 2387b44af61ff4d5915f75fe414d1f12b4e11cd7..d8388b5645a8b04ad9dfce3e3438d05c8a3c5b0b 100644 |
--- a/src/gpu/gl/GrGLGpu.h |
+++ b/src/gpu/gl/GrGLGpu.h |
@@ -19,7 +19,9 @@ |
#include "GrGLVertexArray.h" |
#include "GrGLVertexBuffer.h" |
#include "GrGpu.h" |
+#include "SkMipMapLevel.h" |
#include "GrPipelineBuilder.h" |
+#include "SkTArray.h" |
#include "GrXferProcessor.h" |
#include "SkTypes.h" |
@@ -62,7 +64,7 @@ public: |
ReadPixelTempDrawInfo*) override; |
bool onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, |
- size_t rowBytes, GrPixelConfig srcConfig, DrawPreference*, |
+ GrPixelConfig srcConfig, DrawPreference*, |
WritePixelTempDrawInfo*) override; |
bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) const override; |
@@ -123,10 +125,11 @@ private: |
void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; |
GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCycle lifeCycle, |
- const void* srcData, size_t rowBytes) override; |
+ const SkTArray<SkMipMapLevel>& texels) override; |
GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, |
GrGpuResource::LifeCycle lifeCycle, |
- const void* srcData) override; |
+ const SkTArray<SkMipMapLevel>& texels) override; |
+ |
GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override; |
GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override; |
GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership) override; |
@@ -149,8 +152,8 @@ private: |
bool onWritePixels(GrSurface*, |
int left, int top, int width, int height, |
- GrPixelConfig config, const void* buffer, |
- size_t rowBytes) override; |
+ GrPixelConfig config, |
+ const SkTArray<SkMipMapLevel>& texels) override; |
void onResolveRenderTarget(GrRenderTarget* target) override; |
@@ -255,12 +258,16 @@ private: |
// ensures that such operations don't negatively interact with tracking bound textures. |
void setScratchTextureUnit(); |
+ // colocates all samples at pixel center for render target, if MSAA. |
+ // allows drawing coverage based AA shapes in MSAA mode. |
+ void setColocatedSampleLocations(GrRenderTarget* rt, bool useColocatedSampleLocations); |
+ |
// bounds is region that may be modified and therefore has to be resolved. |
// nullptr means whole target. Can be an empty rect. |
void flushRenderTarget(GrGLRenderTarget*, const SkIRect* bounds); |
void flushStencil(const GrStencilSettings&); |
- void flushHWAAState(GrRenderTarget* rt, bool useHWAA); |
+ void flushHWAAState(GrRenderTarget* rt, bool useHWAA, bool stencilEnabled); |
bool configToGLFormats(GrPixelConfig config, |
bool getSizedInternal, |
@@ -269,11 +276,11 @@ private: |
GrGLenum* externalType) const; |
// helper for onCreateTexture and writeTexturePixels |
bool uploadTexData(const GrSurfaceDesc& desc, |
+ GrGLenum target, |
bool isNewTexture, |
int left, int top, int width, int height, |
GrPixelConfig dataConfig, |
- const void* data, |
- size_t rowBytes); |
+ const SkTArray<SkMipMapLevel>& texels); |
// helper for onCreateCompressedTexture. If width and height are |
// set to -1, then this function will use desc.fWidth and desc.fHeight |
@@ -282,23 +289,29 @@ private: |
// the texture is already in GPU memory and that it's going to be updated |
// with new data. |
bool uploadCompressedTexData(const GrSurfaceDesc& desc, |
- const void* data, |
+ GrGLenum target, |
+ const SkTArray<SkMipMapLevel>& texels, |
bool isNewTexture = true, |
int left = 0, int top = 0, |
int width = -1, int height = -1); |
bool createRenderTargetObjects(const GrSurfaceDesc&, GrGpuResource::LifeCycle lifeCycle, |
- GrGLuint texID, GrGLRenderTarget::IDDesc*); |
+ GrGLenum textureTarget, GrGLuint texID, |
+ GrGLRenderTarget::IDDesc*); |
enum TempFBOTarget { |
kSrc_TempFBOTarget, |
kDst_TempFBOTarget |
}; |
- GrGLuint bindSurfaceAsFBO(GrSurface* surface, GrGLenum fboTarget, GrGLIRect* viewport, |
+ // Binds a surface as a FBO for a copy operation. If the surface already owns an FBO ID then |
+ // that ID is bound. If not the surface is temporarily bound to a FBO and that FBO is bound. |
+ // This must be paired with a call to unbindSurfaceFBOForCopy(). |
+ void bindSurfaceFBOForCopy(GrSurface* surface, GrGLenum fboTarget, GrGLIRect* viewport, |
TempFBOTarget tempFBOTarget); |
- void unbindTextureFromFBO(GrGLenum fboTarget); |
+ // Must be called if bindSurfaceFBOForCopy was used to bind a surface for copying. |
+ void unbindTextureFBOForCopy(GrGLenum fboTarget, GrSurface* surface); |
SkAutoTUnref<GrGLContext> fGLContext; |