aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@google.com>2018-02-13 17:02:19 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-13 17:02:31 +0000
commit559823d1fee3a9e26170d0ac1f3aaa87b3a3c66a (patch)
tree74a3eded6110558487836262490e3eb027534e3c /tests
parent8a83ca4e9afc9e3c08b4e8c33a74392f9b3154d7 (diff)
Revert "Add SkCharacterization creation helper to GrContextThreadSafeProxy"
This reverts commit d76e56d93c27856b10d6636882a5ffcd79a9d967. Reason for revert: broke NexusPlayer Vulkan Original change's description: > Add SkCharacterization creation helper to GrContextThreadSafeProxy > > Change-Id: I8ad7cf335f2b586cf501eaa70573690fbbd53efa > Reviewed-on: https://skia-review.googlesource.com/106105 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: I72b75ff700d39839f7207955566e48bb544aaf6b No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/106968 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/DeferredDisplayListTest.cpp65
1 files changed, 5 insertions, 60 deletions
diff --git a/tests/DeferredDisplayListTest.cpp b/tests/DeferredDisplayListTest.cpp
index 13989a18d7..468a3695e9 100644
--- a/tests/DeferredDisplayListTest.cpp
+++ b/tests/DeferredDisplayListTest.cpp
@@ -20,51 +20,6 @@
#include "SkSurfaceProps.h"
#include "Test.h"
-#include "gl/GrGLDefines.h"
-#ifdef SK_VULKAN
-#include "vk/GrVkDefines.h"
-#endif
-
-static GrBackendFormat create_backend_format(GrContext* context, SkColorType colorType) {
- const GrCaps* caps = context->caps();
-
- switch (context->contextPriv().getBackend()) {
- case kOpenGL_GrBackend:
- if (kRGBA_8888_SkColorType == colorType) {
- GrGLenum format = caps->srgbSupport() ? GR_GL_SRGB8_ALPHA8 : GR_GL_RGBA8;
- return GrBackendFormat::MakeGL(format, GR_GL_TEXTURE_2D);
- } else if (kRGBA_F16_SkColorType == colorType) {
- return GrBackendFormat::MakeGL(GR_GL_RGBA16F, GR_GL_TEXTURE_2D);
- }
- break;
-#ifdef SK_VULKAN
- case kVulkan_GrBackend:
- if (kRGBA_8888_SkColorType == colorType) {
- VkFormat format = caps->srgbSupport() ? VK_FORMAT_R8G8B8A8_SRGB
- : VK_FORMAT_B8G8R8A8_UNORM;
- return GrBackendFormat::MakeVK(format);
- } else if (kRGBA_F16_SkColorType == colorType) {
- return GrBackendFormat::MakeVK(VK_FORMAT_R16G16B16A16_SFLOAT);
- }
- break;
-#endif
- case kMock_GrBackend:
- if (kRGBA_8888_SkColorType == colorType) {
- GrPixelConfig config = caps->srgbSupport() ? kSRGBA_8888_GrPixelConfig
- : kRGBA_8888_GrPixelConfig;
- return GrBackendFormat::MakeMock(config);
- } else if (kRGBA_F16_SkColorType == colorType) {
- return GrBackendFormat::MakeMock(kRGBA_half_GrPixelConfig);
- }
- break;
- default:
- return GrBackendFormat(); // return an invalid format
- }
-
- return GrBackendFormat(); // return an invalid format
-}
-
-
class SurfaceParameters {
public:
static const int kNumParams = 9;
@@ -125,20 +80,8 @@ public:
return nullptr;
}
- int maxResourceCount;
- size_t maxResourceBytes;
- context->getResourceCacheLimits(&maxResourceCount, &maxResourceBytes);
-
- // Note that Ganesh doesn't make use of the SkImageInfo's alphaType
- SkImageInfo ii = SkImageInfo::Make(fWidth, fHeight, fColorType,
- kPremul_SkAlphaType, fColorSpace);
-
- GrBackendFormat backendFormat = create_backend_format(context, fColorType);
-
- SkSurfaceCharacterization c = context->threadSafeProxy()->createCharacterization(
- maxResourceBytes, ii, backendFormat, fSampleCount,
- fOrigin, fSurfaceProps, fShouldCreateMipMaps);
- SkAssertResult(c.isValid());
+ SkSurfaceCharacterization c;
+ SkAssertResult(s->characterize(&c));
SkDeferredDisplayListRecorder r(c);
SkCanvas* canvas = r.getCanvas();
@@ -218,7 +161,6 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(DDLSurfaceCharacterizationTest, reporter, ctxInfo)
SurfaceParameters params;
ddl = params.createDDL(context);
- SkAssertResult(ddl);
// The DDL should draw into an SkSurface created with the same parameters
sk_sp<SkSurface> s = params.make(context);
@@ -270,6 +212,9 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(DDLSurfaceCharacterizationTest, reporter, ctxInfo)
size_t maxResourceBytes;
context->getResourceCacheLimits(&maxResourceCount, &maxResourceBytes);
+ context->setResourceCacheLimits(maxResourceCount/2, maxResourceBytes);
+ REPORTER_ASSERT(reporter, !s->draw(ddl.get()));
+
context->setResourceCacheLimits(maxResourceCount, maxResourceBytes/2);
REPORTER_ASSERT(reporter, !s->draw(ddl.get()));