diff options
author | 2018-03-03 22:43:43 -0500 | |
---|---|---|
committer | 2018-03-05 18:50:25 +0000 | |
commit | 2a4f983c94e4f749fe24b08bc8b5ae7cc8550d1d (patch) | |
tree | e89d794eeffacf09124be0cee8bfc70001be2856 /include | |
parent | 1a8d762a18d6f6494408a3a5e06a80097f8b85f7 (diff) |
Remove GrSurfaceOrigin from GrSurfaceDesc.
This field has no interpretation at the GrTexture/GrGpu as the orientation is
handled at the GrSurfaceProxy level.
This change requires GrGpu to accept a GrSurfaceOrigin when creating a texture with initial data. The origin refers to the texel data to be uploaded. Longer term the plan is to remove this and require the data to be kTopLeft. Additionally, kBottomLeft will only be allowed for wrapped texture/RTs as this evolves.
Change-Id: I7d25b0199aafd9bf3b74c39b2cae451acadcd772
Reviewed-on: https://skia-review.googlesource.com/111806
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrCaps.h | 11 | ||||
-rw-r--r-- | include/gpu/GrTypes.h | 2 | ||||
-rw-r--r-- | include/private/GrRenderTargetProxy.h | 8 | ||||
-rw-r--r-- | include/private/GrSurfaceProxy.h | 13 | ||||
-rw-r--r-- | include/private/GrTextureProxy.h | 7 |
5 files changed, 21 insertions, 20 deletions
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h index 2e01cd9fed..7f1a45ef26 100644 --- a/include/gpu/GrCaps.h +++ b/include/gpu/GrCaps.h @@ -223,13 +223,14 @@ public: /** * This is can be called before allocating a texture to be a dst for copySurface. This is only * used for doing dst copies needed in blends, thus the src is always a GrRenderTargetProxy. It - * will populate the origin, config, and flags fields of the desc such that copySurface can - * efficiently succeed. rectsMustMatch will be set to true if the copy operation must ensure - * that the src and dest rects are identical. disallowSubrect will be set to true if copy rect - * must equal src's bounds. + * will populate config and flags fields of the desc such that copySurface can efficiently + * succeed as well as the proxy origin. rectsMustMatch will be set to true if the copy operation + * must ensure that the src and dest rects are identical. disallowSubrect will be set to true if + * copy rect must equal src's bounds. */ virtual bool initDescForDstCopy(const GrRenderTargetProxy* src, GrSurfaceDesc* desc, - bool* rectsMustMatch, bool* disallowSubrect) const = 0; + GrSurfaceOrigin* origin, bool* rectsMustMatch, + bool* disallowSubrect) const = 0; bool validateSurfaceDesc(const GrSurfaceDesc&, GrMipMapped) const; diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h index ef7426cbba..97d6210259 100644 --- a/include/gpu/GrTypes.h +++ b/include/gpu/GrTypes.h @@ -404,14 +404,12 @@ struct GrMipLevel { struct GrSurfaceDesc { GrSurfaceDesc() : fFlags(kNone_GrSurfaceFlags) - , fOrigin(kTopLeft_GrSurfaceOrigin) , fWidth(0) , fHeight(0) , fConfig(kUnknown_GrPixelConfig) , fSampleCnt(1) {} GrSurfaceFlags fFlags; //!< bitfield of TextureFlags - GrSurfaceOrigin fOrigin; //!< origin of the texture int fWidth; //!< Width of the texture int fHeight; //!< Height of the texture diff --git a/include/private/GrRenderTargetProxy.h b/include/private/GrRenderTargetProxy.h index 783f54e20c..2468df35ad 100644 --- a/include/private/GrRenderTargetProxy.h +++ b/include/private/GrRenderTargetProxy.h @@ -64,8 +64,8 @@ protected: friend class GrProxyProvider; // for ctors // Deferred version - GrRenderTargetProxy(const GrCaps&, const GrSurfaceDesc&, - SkBackingFit, SkBudgeted, uint32_t flags); + GrRenderTargetProxy(const GrCaps&, const GrSurfaceDesc&, GrSurfaceOrigin, SkBackingFit, + SkBudgeted, uint32_t flags); // Lazy-callback version // There are two main use cases for lazily-instantiated proxies: @@ -78,8 +78,8 @@ protected: // The minimal knowledge version is used for CCPR where we are generating an atlas but we do not // know the final size until flush time. GrRenderTargetProxy(LazyInstantiateCallback&&, LazyInstantiationType lazyType, - const GrSurfaceDesc&, SkBackingFit, SkBudgeted, uint32_t flags, - GrRenderTargetFlags renderTargetFlags); + const GrSurfaceDesc&, GrSurfaceOrigin, SkBackingFit, SkBudgeted, + uint32_t flags, GrRenderTargetFlags renderTargetFlags); // Wrapped version GrRenderTargetProxy(sk_sp<GrSurface>, GrSurfaceOrigin); diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h index 6beb11e46f..470ab7de65 100644 --- a/include/private/GrSurfaceProxy.h +++ b/include/private/GrSurfaceProxy.h @@ -355,7 +355,7 @@ public: // Test-only entry point - should decrease in use as proxies propagate static sk_sp<GrSurfaceContext> TestCopy(GrContext* context, const GrSurfaceDesc& dstDesc, - GrSurfaceProxy* srcProxy); + GrSurfaceOrigin, GrSurfaceProxy* srcProxy); bool isWrapped_ForTesting() const; @@ -367,9 +367,10 @@ public: protected: // Deferred version - GrSurfaceProxy(const GrSurfaceDesc& desc, SkBackingFit fit, SkBudgeted budgeted, uint32_t flags) - : GrSurfaceProxy(nullptr, LazyInstantiationType::kSingleUse, - desc, fit, budgeted, flags) { + GrSurfaceProxy(const GrSurfaceDesc& desc, GrSurfaceOrigin origin, SkBackingFit fit, + SkBudgeted budgeted, uint32_t flags) + : GrSurfaceProxy(nullptr, LazyInstantiationType::kSingleUse, desc, origin, fit, + budgeted, flags) { // Note: this ctor pulls a new uniqueID from the same pool at the GrGpuResources } @@ -377,8 +378,8 @@ protected: // Lazy-callback version GrSurfaceProxy(LazyInstantiateCallback&& callback, LazyInstantiationType lazyType, - const GrSurfaceDesc& desc, SkBackingFit fit, SkBudgeted budgeted, - uint32_t flags); + const GrSurfaceDesc& desc, GrSurfaceOrigin origin, SkBackingFit fit, + SkBudgeted budgeted, uint32_t flags); // Wrapped version GrSurfaceProxy(sk_sp<GrSurface> surface, GrSurfaceOrigin origin, SkBackingFit fit); diff --git a/include/private/GrTextureProxy.h b/include/private/GrTextureProxy.h index 508b512ee3..950a78aa1b 100644 --- a/include/private/GrTextureProxy.h +++ b/include/private/GrTextureProxy.h @@ -72,8 +72,8 @@ protected: friend class GrTextureProxyPriv; // Deferred version - GrTextureProxy(const GrSurfaceDesc& srcDesc, GrMipMapped, SkBackingFit, SkBudgeted, - const void* srcData, size_t srcRowBytes, uint32_t flags); + GrTextureProxy(const GrSurfaceDesc& srcDesc, GrSurfaceOrigin, GrMipMapped, SkBackingFit, + SkBudgeted, const void* srcData, size_t srcRowBytes, uint32_t flags); // Lazy-callback version // There are two main use cases for lazily-instantiated proxies: @@ -86,7 +86,8 @@ protected: // The minimal knowledge version is used for CCPR where we are generating an atlas but we do not // know the final size until flush time. GrTextureProxy(LazyInstantiateCallback&&, LazyInstantiationType, const GrSurfaceDesc& desc, - GrMipMapped, SkBackingFit fit, SkBudgeted budgeted, uint32_t flags); + GrSurfaceOrigin, GrMipMapped, SkBackingFit fit, SkBudgeted budgeted, + uint32_t flags); // Wrapped version GrTextureProxy(sk_sp<GrSurface>, GrSurfaceOrigin); |