aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-03-16 16:47:25 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-19 12:21:05 +0000
commitfe0253f8bb64857df088d5ff54e2b5b66b102b46 (patch)
tree0d540ceaf02a992228dd713ccfee9fef413f7b3b /tests
parent4410d7ff757268792dd5f842d585c514cc80a5fb (diff)
Alter GrSurface/GrSurfaceProxy flags to prepare for GrTexture/GrTextureProxy -specific flags
This CL: moves GrRenderTarget::fFlags to GrSurface::fSurfaceFlags adds a GrInternalSurfaceFlags type and uses it for GrSurfaceProxy::fSurfaceFlags The goal of this is to provide a location where GrTexture/GrTextureProxy-specific flags (i.e., isExternal & isRectangle) can be stored. Change-Id: I8df7b79036a6853dd378ff6cf10d4b37c60dd511 Reviewed-on: https://skia-review.googlesource.com/114796 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/LazyProxyTest.cpp4
-rw-r--r--tests/ProxyRefTest.cpp2
-rw-r--r--tests/ProxyTest.cpp3
-rw-r--r--tests/ResourceCacheTest.cpp12
-rw-r--r--tests/TextureProxyTest.cpp6
5 files changed, 14 insertions, 13 deletions
diff --git a/tests/LazyProxyTest.cpp b/tests/LazyProxyTest.cpp
index e21031a50f..2b2b716511 100644
--- a/tests/LazyProxyTest.cpp
+++ b/tests/LazyProxyTest.cpp
@@ -230,7 +230,7 @@ DEF_GPUTEST(LazyProxyReleaseTest, reporter, /* options */) {
*testCountPtr = 1;
return sk_sp<GrTexture>();
},
- desc, kTopLeft_GrSurfaceOrigin, GrMipMapped::kNo, GrRenderTargetFlags::kNone,
+ desc, kTopLeft_GrSurfaceOrigin, GrMipMapped::kNo, GrInternalSurfaceFlags::kNone,
SkBackingFit::kExact, SkBudgeted::kNo, lazyType);
REPORTER_ASSERT(reporter, 0 == testCount);
@@ -422,7 +422,7 @@ DEF_GPUTEST(LazyProxyUninstantiateTest, reporter, /* options */) {
texture->setRelease(UninstantiateReleaseProc, releasePtr);
return texture;
},
- desc, kTopLeft_GrSurfaceOrigin, GrMipMapped::kNo, GrRenderTargetFlags::kNone,
+ desc, kTopLeft_GrSurfaceOrigin, GrMipMapped::kNo, GrInternalSurfaceFlags::kNone,
SkBackingFit::kExact, SkBudgeted::kNo, lazyType);
rtc->priv().testingOnly_addDrawOp(skstd::make_unique<LazyUninstantiateTestOp>(lazyProxy));
diff --git a/tests/ProxyRefTest.cpp b/tests/ProxyRefTest.cpp
index e564397cd4..30cc449c99 100644
--- a/tests/ProxyRefTest.cpp
+++ b/tests/ProxyRefTest.cpp
@@ -74,7 +74,7 @@ static sk_sp<GrTextureProxy> make_deferred(GrProxyProvider* proxyProvider) {
desc.fConfig = kRGBA_8888_GrPixelConfig;
return proxyProvider->createProxy(desc, kBottomLeft_GrSurfaceOrigin, SkBackingFit::kApprox,
- SkBudgeted::kYes, GrResourceProvider::kNoPendingIO_Flag);
+ SkBudgeted::kYes, GrInternalSurfaceFlags::kNoPendingIO);
}
static sk_sp<GrTextureProxy> make_wrapped(GrProxyProvider* proxyProvider) {
diff --git a/tests/ProxyTest.cpp b/tests/ProxyTest.cpp
index 4970e43a20..fa53a7abc9 100644
--- a/tests/ProxyTest.cpp
+++ b/tests/ProxyTest.cpp
@@ -17,6 +17,7 @@
#include "GrRenderTargetPriv.h"
#include "GrRenderTargetProxy.h"
#include "GrResourceProvider.h"
+#include "GrSurfacePriv.h"
#include "GrSurfaceProxyPriv.h"
#include "GrTexture.h"
#include "GrTextureProxy.h"
@@ -72,7 +73,7 @@ static void check_rendertarget(skiatest::Reporter* reporter,
REPORTER_ASSERT(reporter, rt->fsaaType() == rtProxy->fsaaType());
REPORTER_ASSERT(reporter, rt->numColorSamples() == rtProxy->numColorSamples());
REPORTER_ASSERT(reporter, rt->numStencilSamples() == rtProxy->numStencilSamples());
- REPORTER_ASSERT(reporter, rt->renderTargetPriv().flags() == rtProxy->testingOnly_getFlags());
+ REPORTER_ASSERT(reporter, rt->surfacePriv().flags() == rtProxy->testingOnly_getFlags());
}
static void check_texture(skiatest::Reporter* reporter,
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp
index 1844f18364..7b0abc1d2a 100644
--- a/tests/ResourceCacheTest.cpp
+++ b/tests/ResourceCacheTest.cpp
@@ -1644,11 +1644,11 @@ DEF_GPUTEST(ResourceCacheMisc, reporter, /* options */) {
////////////////////////////////////////////////////////////////////////////////
static sk_sp<GrTexture> make_normal_texture(GrResourceProvider* provider,
- GrSurfaceFlags flags,
+ GrSurfaceDescFlags descFlags,
int width, int height,
int sampleCnt) {
GrSurfaceDesc desc;
- desc.fFlags = flags;
+ desc.fFlags = descFlags;
desc.fWidth = width;
desc.fHeight = height;
desc.fConfig = kRGBA_8888_GrPixelConfig;
@@ -1658,18 +1658,18 @@ static sk_sp<GrTexture> make_normal_texture(GrResourceProvider* provider,
}
static sk_sp<GrTextureProxy> make_mipmap_proxy(GrProxyProvider* proxyProvider,
- GrSurfaceFlags flags,
+ GrSurfaceDescFlags descFlags,
int width, int height,
int sampleCnt) {
GrSurfaceDesc desc;
- desc.fFlags = flags;
+ desc.fFlags = descFlags;
desc.fWidth = width;
desc.fHeight = height;
desc.fConfig = kRGBA_8888_GrPixelConfig;
desc.fSampleCnt = sampleCnt;
- auto origin = (flags & kRenderTarget_GrSurfaceFlag) ? kBottomLeft_GrSurfaceOrigin
- : kTopLeft_GrSurfaceOrigin;
+ auto origin = (descFlags & kRenderTarget_GrSurfaceFlag) ? kBottomLeft_GrSurfaceOrigin
+ : kTopLeft_GrSurfaceOrigin;
return proxyProvider->createMipMapProxy(desc, origin, SkBudgeted::kYes);
}
diff --git a/tests/TextureProxyTest.cpp b/tests/TextureProxyTest.cpp
index 5745e4ebd4..8727bef51e 100644
--- a/tests/TextureProxyTest.cpp
+++ b/tests/TextureProxyTest.cpp
@@ -27,9 +27,9 @@ int GrProxyProvider::numUniqueKeyProxies_TestOnly() const {
return fUniquelyKeyedProxies.count();
}
-static GrSurfaceDesc make_desc(GrSurfaceFlags flags) {
+static GrSurfaceDesc make_desc(GrSurfaceDescFlags descFlags) {
GrSurfaceDesc desc;
- desc.fFlags = flags;
+ desc.fFlags = descFlags;
desc.fWidth = 64;
desc.fHeight = 64;
desc.fConfig = kRGBA_8888_GrPixelConfig;
@@ -89,7 +89,7 @@ static sk_sp<GrTextureProxy> wrapped_with_key(skiatest::Reporter* reporter,
// Only budgeted & wrapped external proxies get to carry uniqueKeys
sk_sp<GrTextureProxy> proxy = proxyProvider->createInstantiatedProxy(
- desc, kBottomLeft_GrSurfaceOrigin, fit, SkBudgeted::kYes, 0);
+ desc, kBottomLeft_GrSurfaceOrigin, fit, SkBudgeted::kYes);
SkAssertResult(proxyProvider->assignUniqueKeyToProxy(key, proxy.get()));
REPORTER_ASSERT(reporter, proxy->getUniqueKey().isValid());
return proxy;