aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/GrCaps.h10
-rw-r--r--include/gpu/GrContext.h11
-rw-r--r--include/gpu/GrContextOptions.h12
3 files changed, 21 insertions, 12 deletions
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h
index be62d8a851..e083042ae4 100644
--- a/include/gpu/GrCaps.h
+++ b/include/gpu/GrCaps.h
@@ -84,6 +84,11 @@ public:
bool floatPrecisionVaries() const { return fShaderPrecisionVaries; }
protected:
+ /** Subclasses must call this at the end of their constructors in order to apply caps
+ overrides requested by the client. Note that overrides will only reduce the caps never
+ expand them. */
+ void applyOptionsOverrides(const GrContextOptions& options);
+
bool fShaderDerivativeSupport : 1;
bool fGeometryShaderSupport : 1;
bool fPathRenderingSupport : 1;
@@ -194,6 +199,11 @@ public:
return fDrawPathMasksToCompressedTextureSupport; }
protected:
+ /** Subclasses must call this at the end of their constructors in order to apply caps
+ overrides requested by the client. Note that overrides will only reduce the caps never
+ expand them. */
+ void applyOptionsOverrides(const GrContextOptions& options);
+
SkAutoTUnref<GrShaderCaps> fShaderCaps;
bool fNPOTTextureTileSupport : 1;
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 56ba262b86..8c5f09f736 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -179,15 +179,6 @@ public:
int getMaxTextureSize() const;
/**
- * Temporarily override the true max texture size. Note: an override
- * larger then the true max texture size will have no effect.
- * This entry point is mainly meant for testing texture size dependent
- * features and is only available if defined outside of Skia (see
- * bleed GM.
- */
- void setMaxTextureSizeOverride(int maxTextureSizeOverride);
-
- /**
* Can the provided configuration act as a color render target?
*/
bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const;
@@ -429,8 +420,6 @@ private:
SkTDArray<CleanUpData> fCleanUpData;
- int fMaxTextureSizeOverride;
-
const uint32_t fUniqueID;
GrContext(); // init must be called after the constructor.
diff --git a/include/gpu/GrContextOptions.h b/include/gpu/GrContextOptions.h
index d78ac6cc56..686d6a9ac0 100644
--- a/include/gpu/GrContextOptions.h
+++ b/include/gpu/GrContextOptions.h
@@ -11,14 +11,24 @@
#include "SkTypes.h"
struct GrContextOptions {
- GrContextOptions() : fDrawPathToCompressedTexture(false), fSuppressPrints(false) {}
+ GrContextOptions()
+ : fDrawPathToCompressedTexture(false)
+ , fSuppressPrints(false)
+ , fMaxTextureSizeOverride(SK_MaxS32) {}
// EXPERIMENTAL
// May be removed in the future, or may become standard depending
// on the outcomes of a variety of internal tests.
bool fDrawPathToCompressedTexture;
+
// Suppress prints for the GrContext.
bool fSuppressPrints;
+
+ /** Overrides: These options override feature detection using backend API queries. These
+ overrides can only reduce the feature set or limits, never increase them beyond the
+ detected values. */
+
+ int fMaxTextureSizeOverride;
};
#endif