aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-08-29 08:26:54 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-29 17:36:31 +0000
commitb0e93a22bbfad05bb834e33387880ece56e0f6d2 (patch)
tree41862bc027841d9d03a06661f2f3ef820610a9ac /src/gpu/GrGpu.h
parentaa0ce825b877871f73532beb6fde6bf2f80e99dd (diff)
Remove origin field from GrSurface (take 2)
This mainly consists of rm origin from GrSurface and the wrapBackEnd* methods and then re-adding an explicit origin parameter to all the GrGpu methods that need it. TBR=bsalomon@google.com Change-Id: I4248b2a4749ef844da4233ce53b0dc504bc9eb74 Reviewed-on: https://skia-review.googlesource.com/30280 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrGpu.h')
-rw-r--r--src/gpu/GrGpu.h57
1 files changed, 27 insertions, 30 deletions
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 8f11249463..a0a552c7dc 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -119,24 +119,23 @@ public:
/**
* Implements GrResourceProvider::wrapBackendTexture
*/
- sk_sp<GrTexture> wrapBackendTexture(const GrBackendTexture&, GrSurfaceOrigin, GrWrapOwnership);
+ sk_sp<GrTexture> wrapBackendTexture(const GrBackendTexture&, GrWrapOwnership);
/**
* Implements GrResourceProvider::wrapRenderableBackendTexture
*/
- sk_sp<GrTexture> wrapRenderableBackendTexture(const GrBackendTexture&, GrSurfaceOrigin,
+ sk_sp<GrTexture> wrapRenderableBackendTexture(const GrBackendTexture&,
int sampleCnt, GrWrapOwnership);
/**
* Implements GrResourceProvider::wrapBackendRenderTarget
*/
- sk_sp<GrRenderTarget> wrapBackendRenderTarget(const GrBackendRenderTarget&, GrSurfaceOrigin);
+ sk_sp<GrRenderTarget> wrapBackendRenderTarget(const GrBackendRenderTarget&);
/**
* Implements GrResourceProvider::wrapBackendTextureAsRenderTarget
*/
sk_sp<GrRenderTarget> wrapBackendTextureAsRenderTarget(const GrBackendTexture&,
- GrSurfaceOrigin,
int sampleCnt);
/**
@@ -161,7 +160,7 @@ public:
/**
* Resolves MSAA.
*/
- void resolveRenderTarget(GrRenderTarget* target);
+ void resolveRenderTarget(GrRenderTarget*, GrSurfaceOrigin);
/** Info struct returned by getReadPixelsInfo about performing intermediate draws before
reading pixels for performance or correctness. */
@@ -211,7 +210,8 @@ public:
* that would allow a successful readPixels call. The passed width, height, and rowBytes,
* must be non-zero and already reflect clipping to the src bounds.
*/
- bool getReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeight, size_t rowBytes,
+ bool getReadPixelsInfo(GrSurface* srcSurface, GrSurfaceOrigin srcOrigin,
+ int readWidth, int readHeight, size_t rowBytes,
GrPixelConfig readConfig, DrawPreference*, ReadPixelTempDrawInfo*);
/** Info struct returned by getWritePixelsInfo about performing an intermediate draw in order
@@ -237,7 +237,7 @@ public:
* that would allow a successful transfer of the src pixels to the dst. The passed width,
* height, and rowBytes, must be non-zero and already reflect clipping to the dst bounds.
*/
- bool getWritePixelsInfo(GrSurface* dstSurface, int width, int height,
+ bool getWritePixelsInfo(GrSurface* dstSurface, GrSurfaceOrigin dstOrigin, int width, int height,
GrPixelConfig srcConfig, DrawPreference*, WritePixelTempDrawInfo*);
/**
@@ -259,7 +259,7 @@ public:
* because of a unsupported pixel config or because no render
* target is currently set.
*/
- bool readPixels(GrSurface* surface,
+ bool readPixels(GrSurface* surface, GrSurfaceOrigin,
int left, int top, int width, int height,
GrPixelConfig config, void* buffer, size_t rowBytes);
@@ -275,7 +275,7 @@ public:
* @param texels array of mipmap levels containing texture data
* @param mipLevelCount number of levels in 'texels'
*/
- bool writePixels(GrSurface* surface,
+ bool writePixels(GrSurface* surface, GrSurfaceOrigin origin,
int left, int top, int width, int height,
GrPixelConfig config,
const GrMipLevel texels[], int mipLevelCount);
@@ -288,7 +288,7 @@ public:
* @param rowBytes number of bytes between consecutive rows. Zero
* means rows are tightly packed.
*/
- bool writePixels(GrSurface* surface,
+ bool writePixels(GrSurface* surface, GrSurfaceOrigin origin,
int left, int top, int width, int height,
GrPixelConfig config, const void* buffer,
size_t rowBytes);
@@ -334,8 +334,8 @@ public:
// take place at the GrOpList 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.
- bool copySurface(GrSurface* dst,
- GrSurface* src,
+ bool copySurface(GrSurface* dst, GrSurfaceOrigin dstOrigin,
+ GrSurface* src, GrSurfaceOrigin srcOrigin,
const SkIRect& srcRect,
const SkIPoint& dstPoint);
@@ -554,18 +554,13 @@ private:
const GrMipLevel texels[],
int mipLevelCount) = 0;
- virtual sk_sp<GrTexture> onWrapBackendTexture(const GrBackendTexture&,
- GrSurfaceOrigin,
- GrWrapOwnership) = 0;
+ virtual sk_sp<GrTexture> onWrapBackendTexture(const GrBackendTexture&, GrWrapOwnership) = 0;
virtual sk_sp<GrTexture> onWrapRenderableBackendTexture(const GrBackendTexture&,
- GrSurfaceOrigin,
int sampleCnt,
GrWrapOwnership) = 0;
- virtual sk_sp<GrRenderTarget> onWrapBackendRenderTarget(const GrBackendRenderTarget&,
- GrSurfaceOrigin) = 0;
+ virtual sk_sp<GrRenderTarget> onWrapBackendRenderTarget(const GrBackendRenderTarget&) = 0;
virtual sk_sp<GrRenderTarget> onWrapBackendTextureAsRenderTarget(const GrBackendTexture&,
- GrSurfaceOrigin,
- int sampleCnt)=0;
+ int sampleCnt) = 0;
virtual GrBuffer* onCreateBuffer(size_t size, GrBufferType intendedType, GrAccessPattern,
const void* data) = 0;
@@ -580,15 +575,17 @@ private:
return false;
}
- virtual bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeight,
+ virtual bool onGetReadPixelsInfo(GrSurface* srcSurface, GrSurfaceOrigin srcOrigin,
+ int readWidth, int readHeight,
size_t rowBytes, GrPixelConfig readConfig, DrawPreference*,
ReadPixelTempDrawInfo*) = 0;
- virtual bool onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height,
+ virtual bool onGetWritePixelsInfo(GrSurface* dstSurface, GrSurfaceOrigin dstOrigin,
+ int width, int height,
GrPixelConfig srcConfig, DrawPreference*,
WritePixelTempDrawInfo*) = 0;
// overridden by backend-specific derived class to perform the surface read
- virtual bool onReadPixels(GrSurface*,
+ virtual bool onReadPixels(GrSurface*, GrSurfaceOrigin,
int left, int top,
int width, int height,
GrPixelConfig,
@@ -596,7 +593,7 @@ private:
size_t rowBytes) = 0;
// overridden by backend-specific derived class to perform the surface write
- virtual bool onWritePixels(GrSurface*,
+ virtual bool onWritePixels(GrSurface*, GrSurfaceOrigin,
int left, int top, int width, int height,
GrPixelConfig config,
const GrMipLevel texels[], int mipLevelCount) = 0;
@@ -608,16 +605,16 @@ private:
size_t offset, size_t rowBytes) = 0;
// overridden by backend-specific derived class to perform the resolve
- virtual void onResolveRenderTarget(GrRenderTarget* target) = 0;
+ virtual void onResolveRenderTarget(GrRenderTarget* target, GrSurfaceOrigin) = 0;
// overridden by backend specific derived class to perform the copy surface
- virtual bool onCopySurface(GrSurface* dst,
- GrSurface* src,
- const SkIRect& srcRect,
- const SkIPoint& dstPoint) = 0;
+ virtual bool onCopySurface(GrSurface* dst, GrSurfaceOrigin dstOrigin,
+ GrSurface* src, GrSurfaceOrigin srcOrigin,
+ const SkIRect& srcRect, const SkIPoint& dstPoint) = 0;
// overridden by backend specific derived class to perform the multisample queries
- virtual void onQueryMultisampleSpecs(GrRenderTarget*, const GrStencilSettings&,
+ virtual void onQueryMultisampleSpecs(GrRenderTarget*, GrSurfaceOrigin rtOrigin,
+ const GrStencilSettings&,
int* effectiveSampleCnt, SamplePattern*) = 0;
virtual void onFinishFlush(bool insertedSemaphores) = 0;