From 8c07b7ab53b93b39015a409a4e0a9174feb6a4c3 Mon Sep 17 00:00:00 2001 From: bsalomon Date: Mon, 2 Nov 2015 11:36:52 -0800 Subject: 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 --- include/gpu/GrCaps.h | 4 ++++ include/gpu/GrContextOptions.h | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'include/gpu') 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 -- cgit v1.2.3