aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/gpu
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-10-18 08:33:29 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-18 12:55:06 +0000
commit43f8bf0f784f4182ed0fca9053ecf570caf7ad70 (patch)
tree2a705f6737fceb0d322d6a91d51b01160d68e844 /tools/gpu
parent57caa660c024cf6fda5e1fba8cb21224b51375fe (diff)
Move clear-as-draw workaround to GrGLGpu and expose via GrContextOptions.
Bug: skia:7154 Change-Id: I23ffc11dab4a377fbd6b7e4e33722b3fa0793d58 Reviewed-on: https://skia-review.googlesource.com/60681 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tools/gpu')
-rw-r--r--tools/gpu/GrContextFactory.cpp6
-rw-r--r--tools/gpu/GrContextFactory.h18
2 files changed, 13 insertions, 11 deletions
diff --git a/tools/gpu/GrContextFactory.cpp b/tools/gpu/GrContextFactory.cpp
index b3ca1d929e..1bc4655558 100644
--- a/tools/gpu/GrContextFactory.cpp
+++ b/tools/gpu/GrContextFactory.cpp
@@ -116,7 +116,8 @@ ContextInfo GrContextFactory::getContextInfoInternal(ContextType type, ContextOv
context.fShareIndex == shareIndex &&
!context.fAbandoned) {
context.fTestContext->makeCurrent();
- return ContextInfo(context.fType, context.fTestContext, context.fGrContext);
+ return ContextInfo(context.fType, context.fTestContext, context.fGrContext,
+ context.fOptions);
}
}
@@ -288,7 +289,8 @@ ContextInfo GrContextFactory::getContextInfoInternal(ContextType type, ContextOv
context.fAbandoned = false;
context.fShareContext = shareContext;
context.fShareIndex = shareIndex;
- return ContextInfo(context.fType, context.fTestContext, context.fGrContext);
+ context.fOptions = grOptions;
+ return ContextInfo(context.fType, context.fTestContext, context.fGrContext, context.fOptions);
}
ContextInfo GrContextFactory::getContextInfo(ContextType type, ContextOverrides overrides) {
diff --git a/tools/gpu/GrContextFactory.h b/tools/gpu/GrContextFactory.h
index 8d3e69c765..1073f6a594 100644
--- a/tools/gpu/GrContextFactory.h
+++ b/tools/gpu/GrContextFactory.h
@@ -159,6 +159,7 @@ private:
struct Context {
ContextType fType;
ContextOverrides fOverrides;
+ GrContextOptions fOptions;
GrBackend fBackend;
TestContext* fTestContext;
GrContext* fGrContext;
@@ -189,19 +190,18 @@ public:
return static_cast<GLTestContext*>(fTestContext);
}
+ const GrContextOptions& options() const { return fOptions; }
+
private:
- ContextInfo(GrContextFactory::ContextType type,
- TestContext* testContext,
- GrContext* grContext)
- : fType(type)
- , fTestContext(testContext)
- , fGrContext(grContext) {
- }
+ ContextInfo(GrContextFactory::ContextType type, TestContext* testContext, GrContext* grContext,
+ const GrContextOptions& options)
+ : fType(type), fTestContext(testContext), fGrContext(grContext), fOptions(options) {}
GrContextFactory::ContextType fType = GrContextFactory::kGL_ContextType;
// Valid until the factory destroys it via abandonContexts() or destroyContexts().
- TestContext* fTestContext = nullptr;
- GrContext* fGrContext = nullptr;
+ TestContext* fTestContext = nullptr;
+ GrContext* fGrContext = nullptr;
+ GrContextOptions fOptions;
friend class GrContextFactory;
};