aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-11-02 11:36:52 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-11-02 11:36:52 -0800
commit8c07b7ab53b93b39015a409a4e0a9174feb6a4c3 (patch)
tree241791dd1f6d64be7a16ead5d47e1f02e265a8bc /include/gpu
parent8b99ef434736791eefb31ecaa590a649dff83aed (diff)
Allow max tile size to be overridden separately from max texture size.
This allows internal Gr texture creation code to succeed for extraneous textures while running the bleed GM. This means we can turn on the shader variants. Review URL: https://codereview.chromium.org/1418473004
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/GrCaps.h4
-rw-r--r--include/gpu/GrContextOptions.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h
index 811a74ff48..6893dc7b5e 100644
--- a/include/gpu/GrCaps.h
+++ b/include/gpu/GrCaps.h
@@ -189,6 +189,9 @@ public:
int maxRenderTargetSize() const { return fMaxRenderTargetSize; }
int maxTextureSize() const { return fMaxTextureSize; }
+ /** This is the maximum tile size to use by GPU devices for rendering sw-backed images/bitmaps.
+ It is usually the max texture size, unless we're overriding it for testing. */
+ int maxTileSize() const { SkASSERT(fMaxTileSize <= fMaxTextureSize); return fMaxTileSize; }
// Will be 0 if MSAA is not supported
int maxSampleCount() const { return fMaxSampleCount; }
@@ -263,6 +266,7 @@ protected:
int fMaxRenderTargetSize;
int fMaxTextureSize;
+ int fMaxTileSize;
int fMaxSampleCount;
// The first entry for each config is without msaa and the second is with.
diff --git a/include/gpu/GrContextOptions.h b/include/gpu/GrContextOptions.h
index 4b70105559..5619e3063b 100644
--- a/include/gpu/GrContextOptions.h
+++ b/include/gpu/GrContextOptions.h
@@ -15,6 +15,7 @@ struct GrContextOptions {
: fDrawPathToCompressedTexture(false)
, fSuppressPrints(false)
, fMaxTextureSizeOverride(SK_MaxS32)
+ , fMaxTileSizeOverride(0)
, fSuppressDualSourceBlending(false)
, fGeometryBufferMapThreshold(-1)
, fUseDrawInsteadOfPartialRenderTargetWrite(false)
@@ -33,6 +34,9 @@ struct GrContextOptions {
detected values. */
int fMaxTextureSizeOverride;
+ /** If non-zero, overrides the maximum size of a tile for sw-backed images and bitmaps rendered
+ by SkGpuDevice. */
+ int fMaxTileSizeOverride;
bool fSuppressDualSourceBlending;
/** the threshold in bytes above which we will use a buffer mapping API to map vertex and index