Reduce window rectangles cap to 8
authorcsmartdalton <csmartdalton@google.com>
Wed, 17 Aug 2016 20:52:15 +0000 (13:52 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 17 Aug 2016 20:52:15 +0000 (13:52 -0700)
Lowers the cap to 8 and adds a warning message if this value is ever
exceeded. The largest (only) implementation currently supports 8, so
there isn't yet reason to go higher.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2254013002

Review-Url: https://codereview.chromium.org/2254013002

src/gpu/GrCaps.cpp
src/gpu/GrWindowRectangles.h

index 622c6855fae0ad93e29fd05c4fc6c62a0b65df45..9f92210ae8bce6db26ab211ccb1cb543e70260ef 100644 (file)
@@ -141,6 +141,8 @@ void GrCaps::applyOptionsOverrides(const GrContextOptions& options) {
         fMaxTileSize = options.fMaxTileSizeOverride;
     }
     if (fMaxWindowRectangles > GrWindowRectangles::kMaxWindows) {
+        SkDebugf("WARNING: capping window rectangles at %i. HW advertises support for %i.\n",
+                 GrWindowRectangles::kMaxWindows, fMaxWindowRectangles);
         fMaxWindowRectangles = GrWindowRectangles::kMaxWindows;
     }
 }
index 682af9353d9e4ceb0765cf5ac4f6b005d6b5dfee..f83f8ddd41e8ca48564a5944054df77ee77b5a94 100644 (file)
@@ -13,7 +13,7 @@
 
 class GrWindowRectangles {
 public:
-    constexpr static int kMaxWindows = 16;
+    constexpr static int kMaxWindows = 8;
 
     enum class Mode : bool {
         kExclusive,