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>
diff --git a/include/private/GrRenderTargetProxy.h b/include/private/GrRenderTargetProxy.h
index 783f54e..2468df3 100644
--- a/include/private/GrRenderTargetProxy.h
+++ b/include/private/GrRenderTargetProxy.h
@@ -64,8 +64,8 @@
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 @@
// 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 6beb11e..470ab7d 100644
--- a/include/private/GrSurfaceProxy.h
+++ b/include/private/GrSurfaceProxy.h
@@ -355,7 +355,7 @@
// 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 @@
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 @@
// 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 508b512..950a78a 100644
--- a/include/private/GrTextureProxy.h
+++ b/include/private/GrTextureProxy.h
@@ -72,8 +72,8 @@
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 @@
// 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);