aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar krajcevski <krajcevski@google.com>2014-08-12 07:26:25 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-12 07:26:26 -0700
commit9c6d4d744a9e0375d0e7d7a7b19558f5259fc3c3 (patch)
tree404ec54de399e7a7854308ef192a513eb7fad18a /include
parent03bde3e6fa8deaf635bd19b45de69ebea71ec299 (diff)
Change GR_COMPRESS_ALPHA_MASK from compile-time flag to run-time. We do this by introducing an Options struct to be passed to a GrContext on creation.
R=robertphillips@google.com, bsalomon@google.com Author: krajcevski@google.com Review URL: https://codereview.chromium.org/459033002
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrContext.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 39f5be728f..d6245100d6 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -49,10 +49,19 @@ class SK_API GrContext : public SkRefCnt {
public:
SK_DECLARE_INST_COUNT(GrContext)
+ struct Options {
+ Options() : fDrawPathToCompressedTexture(false) { }
+
+ // EXPERIMENTAL
+ // May be removed in the future, or may become standard depending
+ // on the outcomes of a variety of internal tests.
+ bool fDrawPathToCompressedTexture;
+ };
+
/**
* Creates a GrContext for a backend context.
*/
- static GrContext* Create(GrBackend, GrBackendContext);
+ static GrContext* Create(GrBackend, GrBackendContext, const Options* opts = NULL);
virtual ~GrContext();
@@ -939,6 +948,12 @@ public:
GrPathRendererChain::DrawType drawType = GrPathRendererChain::kColor_DrawType,
GrPathRendererChain::StencilSupport* stencilSupport = NULL);
+ /**
+ * This returns a copy of the the GrContext::Options that was passed to the
+ * constructor of this class.
+ */
+ const Options& getOptions() const { return fOptions; }
+
#if GR_CACHE_STATS
void printCacheStats() const;
#endif
@@ -987,7 +1002,9 @@ private:
int fMaxTextureSizeOverride;
- GrContext(); // init must be called after the constructor.
+ const Options fOptions;
+
+ GrContext(const Options&); // init must be called after the constructor.
bool init(GrBackend, GrBackendContext);
void setupDrawBuffer();