Revert "DM: Add a per-sink MemoryCache to all GPU sinks"

This reverts commit a7b224d3a3.

Reason for revert: Failures on some ANGLE bots

Original change's description:
> DM: Add a per-sink MemoryCache to all GPU sinks
> 
> This isolates the caches per config, so we don't try to reuse cached
> binaries across different GL versions (or different D3D backend versions
> on ANGLE bots, etc).
> 
> Locally, this sped up ANGLE significantly Looking at a sample bot
> (NUC6i5SYK), it dropped DM from 36m to 31m.
> 
> Change-Id: I95db18c6ea85041e6adbc972f0118233c82818fb
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223985
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,brianosman@google.com

Change-Id: I8c9af65d89fddb28e5f1395a6c946312f27ba48a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224186
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Osman 2019-06-27 14:39:00 +00:00 committed by Skia Commit-Bot
parent 2e1e50435a
commit 1958fbbcff
3 changed files with 10 additions and 8 deletions

View File

@ -1331,7 +1331,6 @@ static DEFINE_bool(releaseAndAbandonGpuContext, false,
"Test releasing all gpu resources and abandoning the GrContext "
"after running each test");
static DEFINE_bool(drawOpClip, false, "Clip each GrDrawOp to its device bounds for testing.");
static DEFINE_bool(programBinaryCache, true, "Use in-memory program binary cache");
GPUSink::GPUSink(GrContextFactory::ContextType ct,
GrContextFactory::ContextOverrides overrides,
@ -1352,11 +1351,7 @@ GPUSink::GPUSink(GrContextFactory::ContextType ct,
, fAlphaType(alphaType)
, fColorSpace(std::move(colorSpace))
, fThreaded(threaded)
, fBaseContextOptions(grCtxOptions) {
if (FLAGS_programBinaryCache) {
fBaseContextOptions.fPersistentCache = &fMemoryCache;
}
}
, fBaseContextOptions(grCtxOptions) {}
Error GPUSink::draw(const Src& src, SkBitmap* dst, SkWStream* dstStream, SkString* log) const {
return this->onDraw(src, dst, dstStream, log, fBaseContextOptions);

View File

@ -18,7 +18,6 @@
#include "src/core/SkBBoxHierarchy.h"
#include "src/utils/SkMultiPictureDocument.h"
#include "tools/flags/CommonFlagsConfig.h"
#include "tools/gpu/MemoryCache.h"
//#define TEST_VIA_SVG
@ -364,7 +363,6 @@ private:
sk_sp<SkColorSpace> fColorSpace;
bool fThreaded;
GrContextOptions fBaseContextOptions;
sk_gpu_test::MemoryCache fMemoryCache;
};
class GPUThreadTestingSink : public GPUSink {

View File

@ -8,6 +8,8 @@
#include "include/core/SkExecutor.h"
#include "include/gpu/GrContextOptions.h"
#include "tools/flags/CommonFlags.h"
#include "tools/gpu/MemoryCache.h"
DEFINE_int(gpuThreads,
2,
@ -32,6 +34,8 @@ static DEFINE_bool(disableDriverCorrectnessWorkarounds, false,
static DEFINE_bool(reduceOpListSplitting, false, "Improve opList sorting");
static DEFINE_bool(dontReduceOpListSplitting, false, "Allow more opList splitting");
static DEFINE_bool(programBinaryCache, false, "Use in-memory program binary cache");
static GpuPathRenderers get_named_pathrenderers_flags(const char* name) {
if (!strcmp(name, "none")) {
return GpuPathRenderers::kNone;
@ -90,6 +94,11 @@ void SetCtxOptionsFromCommonFlags(GrContextOptions* ctxOptions) {
ctxOptions->fGpuPathRenderers = collect_gpu_path_renderers_from_flags();
ctxOptions->fDisableDriverCorrectnessWorkarounds = FLAGS_disableDriverCorrectnessWorkarounds;
if (FLAGS_programBinaryCache) {
static sk_gpu_test::MemoryCache gMemoryCache;
ctxOptions->fPersistentCache = &gMemoryCache;
}
if (FLAGS_reduceOpListSplitting) {
SkASSERT(!FLAGS_dontReduceOpListSplitting);
ctxOptions->fReduceOpListSplitting = GrContextOptions::Enable::kYes;