Use SK_DISABLE_DEFERRED_PROXIES to only disable deferred proxies for Chrome

This relies on https://chromium-review.googlesource.com/c/chromium/src/+/700475 (Readd SK_DISABLE_DEFERRED_PROXIES flag) landing in Chrome first.

It refines the changes made in: https://skia-review.googlesource.com/c/skia/+/54004 (Temporarily disable deferred texture proxies)

Change-Id: I12af50349516d32f74cd7f7dfd25a668284f64fa
Reviewed-on: https://skia-review.googlesource.com/55100
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Robert Phillips 2017-10-04 08:42:28 -04:00 committed by Skia Commit-Bot
parent 490847e209
commit fa8c080449
3 changed files with 18 additions and 3 deletions

View File

@ -267,6 +267,7 @@ sk_sp<GrTextureProxy> GrSurfaceProxy::MakeDeferred(GrResourceProvider* resourceP
GrSurfaceDesc copyDesc = desc;
copyDesc.fSampleCnt = caps->getSampleCount(desc.fSampleCnt, desc.fConfig);
#ifdef SK_DISABLE_DEFERRED_PROXIES
// Temporarily force instantiation for crbug.com/769760
if (willBeRT) {
// We know anything we instantiate later from this deferred path will be
@ -286,6 +287,16 @@ sk_sp<GrTextureProxy> GrSurfaceProxy::MakeDeferred(GrResourceProvider* resourceP
}
return nullptr;
#else
if (willBeRT) {
// We know anything we instantiate later from this deferred path will be
// both texturable and renderable
return sk_sp<GrTextureProxy>(new GrTextureRenderTargetProxy(*caps, copyDesc, fit,
budgeted, flags));
}
return sk_sp<GrTextureProxy>(new GrTextureProxy(copyDesc, fit, budgeted, nullptr, 0, flags));
#endif
}
sk_sp<GrTextureProxy> GrSurfaceProxy::MakeDeferred(GrResourceProvider* resourceProvider,

View File

@ -8,7 +8,8 @@
// Include here to ensure SK_SUPPORT_GPU is set correctly before it is examined.
#include "SkTypes.h"
#if 0
#if SK_SUPPORT_GPU
#ifndef SK_DISABLE_DEFERRED_PROXIES
#include "Test.h"
#include "GrContextPriv.h"
@ -198,3 +199,4 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ResourceAllocatorTest, reporter, ctxInfo) {
}
#endif
#endif

View File

@ -254,7 +254,7 @@ static void invalidation_test(GrContext* context, skiatest::Reporter* reporter)
REPORTER_ASSERT(reporter, 0 == cache->getResourceCount());
}
#if 0
#ifndef SK_DISABLE_DEFERRED_PROXIES
// Test if invalidating unique ids prior to instantiating operates as expected
static void invalidation_and_instantiation_test(GrContext* context, skiatest::Reporter* reporter) {
GrResourceProvider* provider = context->resourceProvider();
@ -318,7 +318,9 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TextureProxyTest, reporter, ctxInfo) {
}
invalidation_test(context, reporter);
//invalidation_and_instantiation_test(context, reporter);
#ifndef SK_DISABLE_DEFERRED_PROXIES
invalidation_and_instantiation_test(context, reporter);
#endif
}
#endif