Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: include/gpu/GrContext.h

Issue 459033002: Change GR_COMPRESS_ALPHA_MASK from compile-time flag to run-time flag (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Pass options struct to GrContext Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/gpu.gyp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrContext.h
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 39f5be728f85b171920d841b842f69791905fa77..f5f0930bb0513d59504bb2c57ffda5c4102255a9 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -49,10 +49,15 @@ class SK_API GrContext : public SkRefCnt {
public:
SK_DECLARE_INST_COUNT(GrContext)
+ struct Options {
+ Options();
+ bool fDrawPathToCompressedTexture;
bsalomon 2014/08/11 19:00:47 Should we label this field experimental or somethi
krajcevski 2014/08/11 19:09:55 Done.
+ };
+
/**
* Creates a GrContext for a backend context.
*/
- static GrContext* Create(GrBackend, GrBackendContext);
+ static GrContext* Create(GrBackend, GrBackendContext, const Options* opts = NULL);
virtual ~GrContext();
@@ -322,6 +327,14 @@ public:
*/
void setMaxTextureSizeOverride(int maxTextureSizeOverride);
+ /**
+ * This returns true if the underlying graphics device and system is
+ * capable of drawing paths to compressed textures. This generally provides
+ * a speedup on mobile devices with advanced GPUs, but it only gets turned
+ * on when there is a clear speedup benefit.
+ */
+ bool supportsDrawPathToCompressedTexture() const;
bsalomon 2014/08/11 19:00:47 Does this need to be public? It feels like we're e
krajcevski 2014/08/11 19:09:55 I moved it to the "for internal use only" section.
+
///////////////////////////////////////////////////////////////////////////
// Render targets
@@ -986,9 +999,10 @@ private:
SkTDArray<CleanUpData> fCleanUpData;
int fMaxTextureSizeOverride;
+ bool fSupportsDrawPathToCompressed;
GrContext(); // init must be called after the constructor.
- bool init(GrBackend, GrBackendContext);
+ bool init(GrBackend, GrBackendContext, const Options& opts);
void setupDrawBuffer();
« no previous file with comments | « gyp/gpu.gyp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698