aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-07-21 14:17:45 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-21 14:17:54 +0000
commit96be9df1300b2281641b038ef11064157f6e0b41 (patch)
tree2d7c80612daa3fd76114fe158fe2857cce9b2cb0 /tests
parent7877d3237826fc4985af3e9d540cff79e408ef34 (diff)
Revert "Reduce dependence on GrSurface's origin field"
This reverts commit 467022b1861033d968195687da15270c208279ff. Reason for revert: GrAHardwareBufferImageGenerator.cpp Original change's description: > Reduce dependence on GrSurface's origin field > > Unfortunately, GrGPU and its ilk are still using the GrSurface's origin a lot. I will clean that up in a second CL. > > Change-Id: Iba729440ce8ea8d24bb7f4e5de55ed576a0f176d > Reviewed-on: https://skia-review.googlesource.com/24700 > Commit-Queue: Robert Phillips <robertphillips@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,robertphillips@google.com Change-Id: I1b3f5c3b82d250ac164beb1d5c83abb6c3c6ab3b No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/25620 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/GrSurfaceTest.cpp2
-rw-r--r--tests/ImageFilterCacheTest.cpp3
-rw-r--r--tests/ProcessorTest.cpp3
-rw-r--r--tests/ProxyConversionTest.cpp6
-rw-r--r--tests/ProxyRefTest.cpp3
-rw-r--r--tests/ProxyTest.cpp7
-rw-r--r--tests/ReadWriteAlphaTest.cpp2
-rw-r--r--tests/ResourceCacheTest.cpp2
-rw-r--r--tests/SRGBMipMapTest.cpp1
-rw-r--r--tests/SpecialImageTest.cpp3
-rw-r--r--tests/SurfaceTest.cpp6
11 files changed, 14 insertions, 24 deletions
diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp
index f1d6a269bc..d67f1038fc 100644
--- a/tests/GrSurfaceTest.cpp
+++ b/tests/GrSurfaceTest.cpp
@@ -184,7 +184,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(InitialTextureClear, reporter, context_info)
if (!tex) {
continue;
}
- auto proxy = GrSurfaceProxy::MakeWrapped(std::move(tex), desc.fOrigin);
+ auto proxy = GrSurfaceProxy::MakeWrapped(std::move(tex));
auto texCtx = context->contextPriv().makeWrappedSurfaceContext(
std::move(proxy), nullptr);
SkImageInfo info = SkImageInfo::Make(
diff --git a/tests/ImageFilterCacheTest.cpp b/tests/ImageFilterCacheTest.cpp
index 86ecb15f6e..d718181758 100644
--- a/tests/ImageFilterCacheTest.cpp
+++ b/tests/ImageFilterCacheTest.cpp
@@ -190,9 +190,8 @@ static sk_sp<GrTextureProxy> create_proxy(GrResourceProvider* resourceProvider)
SkBitmap srcBM = create_bm();
GrSurfaceDesc desc;
- desc.fFlags = kNone_GrSurfaceFlags;
- desc.fOrigin = kTopLeft_GrSurfaceOrigin;
desc.fConfig = kRGBA_8888_GrPixelConfig;
+ desc.fFlags = kNone_GrSurfaceFlags;
desc.fWidth = kFullSize;
desc.fHeight = kFullSize;
diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp
index eac6aab274..fd025a0cb4 100644
--- a/tests/ProcessorTest.cpp
+++ b/tests/ProcessorTest.cpp
@@ -302,10 +302,9 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ProcessorOptimizationValidationTest, repor
sk_sp<GrRenderTargetContext> rtc = context->makeDeferredRenderTargetContext(
SkBackingFit::kExact, 256, 256, kRGBA_8888_GrPixelConfig, nullptr);
GrSurfaceDesc desc;
- desc.fFlags = kRenderTarget_GrSurfaceFlag;
- desc.fOrigin = kBottomLeft_GrSurfaceOrigin;
desc.fWidth = 256;
desc.fHeight = 256;
+ desc.fFlags = kRenderTarget_GrSurfaceFlag;
desc.fConfig = kRGBA_8888_GrPixelConfig;
sk_sp<GrTextureProxy> proxies[2];
diff --git a/tests/ProxyConversionTest.cpp b/tests/ProxyConversionTest.cpp
index 23ca695d42..513b680045 100644
--- a/tests/ProxyConversionTest.cpp
+++ b/tests/ProxyConversionTest.cpp
@@ -29,7 +29,7 @@ static sk_sp<GrSurfaceProxy> make_wrapped_FBO0(GrResourceProvider* provider,
sk_sp<GrRenderTarget> defaultFBO(provider->wrapBackendRenderTarget(backendRT, desc.fOrigin));
SkASSERT(!defaultFBO->asTexture());
- return GrSurfaceProxy::MakeWrapped(std::move(defaultFBO), desc.fOrigin);
+ return GrSurfaceProxy::MakeWrapped(std::move(defaultFBO));
}
static sk_sp<GrSurfaceProxy> make_wrapped_offscreen_rt(GrResourceProvider* provider,
@@ -40,7 +40,7 @@ static sk_sp<GrSurfaceProxy> make_wrapped_offscreen_rt(GrResourceProvider* provi
sk_sp<GrTexture> tex(provider->createTexture(desc, budgeted));
- return GrSurfaceProxy::MakeWrapped(std::move(tex), desc.fOrigin);
+ return GrSurfaceProxy::MakeWrapped(std::move(tex));
}
static sk_sp<GrSurfaceProxy> make_wrapped_texture(GrResourceProvider* provider,
@@ -48,7 +48,7 @@ static sk_sp<GrSurfaceProxy> make_wrapped_texture(GrResourceProvider* provider,
SkBudgeted budgeted) {
sk_sp<GrTexture> tex(provider->createTexture(desc, budgeted));
- return GrSurfaceProxy::MakeWrapped(std::move(tex), desc.fOrigin);
+ return GrSurfaceProxy::MakeWrapped(std::move(tex));
}
// Test converting between RenderTargetProxies and TextureProxies for wrapped
diff --git a/tests/ProxyRefTest.cpp b/tests/ProxyRefTest.cpp
index 3648122652..04510b3e7f 100644
--- a/tests/ProxyRefTest.cpp
+++ b/tests/ProxyRefTest.cpp
@@ -80,14 +80,13 @@ static sk_sp<GrTextureProxy> make_deferred(GrContext* context) {
static sk_sp<GrTextureProxy> make_wrapped(GrContext* context) {
GrSurfaceDesc desc;
desc.fFlags = kRenderTarget_GrSurfaceFlag;
- desc.fOrigin = kBottomLeft_GrSurfaceOrigin;
desc.fWidth = kWidthHeight;
desc.fHeight = kWidthHeight;
desc.fConfig = kRGBA_8888_GrPixelConfig;
sk_sp<GrTexture> tex(context->resourceProvider()->createTexture(desc, SkBudgeted::kNo));
- return GrSurfaceProxy::MakeWrapped(std::move(tex), desc.fOrigin);
+ return GrSurfaceProxy::MakeWrapped(std::move(tex));
}
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ProxyRefTest, reporter, ctxInfo) {
diff --git a/tests/ProxyTest.cpp b/tests/ProxyTest.cpp
index 547d3b2ce3..dd1f4cbe43 100644
--- a/tests/ProxyTest.cpp
+++ b/tests/ProxyTest.cpp
@@ -236,8 +236,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
sk_sp<GrRenderTarget> defaultFBO(
provider->wrapBackendRenderTarget(backendRT, origin));
- sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeWrapped(defaultFBO,
- origin));
+ sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeWrapped(defaultFBO));
check_surface(reporter, sProxy.get(), origin,
kWidthHeight, kWidthHeight, config,
defaultFBO->uniqueID(), SkBudgeted::kNo);
@@ -253,7 +252,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
tex = provider->createTexture(desc, budgeted);
sk_sp<GrRenderTarget> rt(sk_ref_sp(tex->asRenderTarget()));
- sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeWrapped(rt, origin));
+ sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeWrapped(rt));
check_surface(reporter, sProxy.get(), origin,
kWidthHeight, kWidthHeight, config,
rt->uniqueID(), budgeted);
@@ -268,7 +267,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
tex = provider->createTexture(desc, budgeted);
}
- sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeWrapped(tex, origin));
+ sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeWrapped(tex));
check_surface(reporter, sProxy.get(), origin,
kWidthHeight, kWidthHeight, config, tex->uniqueID(), budgeted);
check_texture(reporter, provider, sProxy->asTextureProxy(),
diff --git a/tests/ReadWriteAlphaTest.cpp b/tests/ReadWriteAlphaTest.cpp
index 2e5a1dc12d..344400cca7 100644
--- a/tests/ReadWriteAlphaTest.cpp
+++ b/tests/ReadWriteAlphaTest.cpp
@@ -50,7 +50,6 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) {
{
GrSurfaceDesc desc;
desc.fFlags = kNone_GrSurfaceFlags;
- desc.fOrigin = kTopLeft_GrSurfaceOrigin;
desc.fConfig = kAlpha_8_GrPixelConfig; // it is a single channel texture
desc.fWidth = X_SIZE;
desc.fHeight = Y_SIZE;
@@ -154,7 +153,6 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) {
for (int rt = 0; rt < 2; ++rt) {
GrSurfaceDesc desc;
desc.fFlags = rt ? kRenderTarget_GrSurfaceFlag : kNone_GrSurfaceFlags;
- desc.fOrigin = rt ? kBottomLeft_GrSurfaceOrigin : kTopLeft_GrSurfaceOrigin;
desc.fConfig = config;
desc.fWidth = X_SIZE;
desc.fHeight = Y_SIZE;
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp
index 58cf583ed3..3cfa157924 100644
--- a/tests/ResourceCacheTest.cpp
+++ b/tests/ResourceCacheTest.cpp
@@ -1673,8 +1673,6 @@ static sk_sp<GrTextureProxy> make_mipmap_proxy(GrResourceProvider* provider,
GrSurfaceDesc desc;
desc.fFlags = flags;
- desc.fOrigin = (flags & kRenderTarget_GrSurfaceFlag) ? kBottomLeft_GrSurfaceOrigin
- : kTopLeft_GrSurfaceOrigin;
desc.fWidth = width;
desc.fHeight = height;
desc.fConfig = kRGBA_8888_GrPixelConfig;
diff --git a/tests/SRGBMipMapTest.cpp b/tests/SRGBMipMapTest.cpp
index 07332e4282..8d035e1589 100644
--- a/tests/SRGBMipMapTest.cpp
+++ b/tests/SRGBMipMapTest.cpp
@@ -124,7 +124,6 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SRGBMipMaps, reporter, ctxInfo) {
// Create our test texture
GrSurfaceDesc desc;
desc.fFlags = kNone_GrSurfaceFlags;
- desc.fOrigin = kTopLeft_GrSurfaceOrigin;
desc.fConfig = kSRGBA_8888_GrPixelConfig;
desc.fWidth = texS;
desc.fHeight = texS;
diff --git a/tests/SpecialImageTest.cpp b/tests/SpecialImageTest.cpp
index 3574f38129..70d6fd4b38 100644
--- a/tests/SpecialImageTest.cpp
+++ b/tests/SpecialImageTest.cpp
@@ -301,9 +301,8 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_DeferredGpu, reporter, ctxInfo)
SkBitmap bm = create_bm();
GrSurfaceDesc desc;
- desc.fFlags = kNone_GrSurfaceFlags;
- desc.fOrigin = kTopLeft_GrSurfaceOrigin;
desc.fConfig = kSkia8888_GrPixelConfig;
+ desc.fFlags = kNone_GrSurfaceFlags;
desc.fWidth = kFullSize;
desc.fHeight = kFullSize;
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index 797750f3b1..5249b3d562 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -599,7 +599,7 @@ static sk_sp<SkSurface> create_gpu_surface_backend_texture(
backendHandle);
sk_sp<SkSurface> surface = SkSurface::MakeFromBackendTexture(context, backendTex,
- kTopLeft_GrSurfaceOrigin, sampleCnt,
+ kDefault_GrSurfaceOrigin, sampleCnt,
nullptr, nullptr);
if (!surface) {
context->getGpu()->deleteTestingOnlyBackendTexture(backendHandle);
@@ -625,7 +625,7 @@ static sk_sp<SkSurface> create_gpu_surface_backend_texture_as_render_target(
kRGBA_8888_GrPixelConfig,
backendHandle);
sk_sp<SkSurface> surface = SkSurface::MakeFromBackendTextureAsRenderTarget(
- context, backendTex, kTopLeft_GrSurfaceOrigin, sampleCnt, nullptr, nullptr);
+ context, backendTex, kDefault_GrSurfaceOrigin, sampleCnt, nullptr, nullptr);
if (!surface) {
context->getGpu()->deleteTestingOnlyBackendTexture(backendHandle);
@@ -907,7 +907,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCreationWithColorSpace_Gpu, reporter,
backendHandle);
return SkSurface::MakeFromBackendTexture(context, backendTex,
- kTopLeft_GrSurfaceOrigin, 0,
+ kDefault_GrSurfaceOrigin, 0,
sk_ref_sp(info.colorSpace()), nullptr);
};