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

Side by Side Diff: src/gpu/GrWindowRectangles.h

Issue 2254013002: Reduce window rectangles cap to 8 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reduce window rectangles cap to 8 Created 4 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrCaps.cpp ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrWindowRectangles_DEFINED 8 #ifndef GrWindowRectangles_DEFINED
9 #define GrWindowRectangles_DEFINED 9 #define GrWindowRectangles_DEFINED
10 10
11 #include "GrNonAtomicRef.h" 11 #include "GrNonAtomicRef.h"
12 #include "SkRect.h" 12 #include "SkRect.h"
13 13
14 class GrWindowRectangles { 14 class GrWindowRectangles {
15 public: 15 public:
16 constexpr static int kMaxWindows = 16; 16 constexpr static int kMaxWindows = 8;
17 17
18 enum class Mode : bool { 18 enum class Mode : bool {
19 kExclusive, 19 kExclusive,
20 kInclusive 20 kInclusive
21 }; 21 };
22 22
23 GrWindowRectangles(Mode mode = Mode::kExclusive) : fMode(mode), fCount(0) {} 23 GrWindowRectangles(Mode mode = Mode::kExclusive) : fMode(mode), fCount(0) {}
24 GrWindowRectangles(const GrWindowRectangles& that) : fCount(0) { *this = tha t; } 24 GrWindowRectangles(const GrWindowRectangles& that) : fCount(0) { *this = tha t; }
25 ~GrWindowRectangles() { SkSafeUnref(this->rec()); } 25 ~GrWindowRectangles() { SkSafeUnref(this->rec()); }
26 26
27 Mode mode() const { return fMode; } 27 Mode mode() const { return fMode; }
28 uint16_t count() const { return fCount; } 28 int count() const { return fCount; }
29 bool disabled() const { return Mode::kExclusive == fMode && !fCount; } 29 bool disabled() const { return Mode::kExclusive == fMode && !fCount; }
30 const SkIRect* data() const; 30 const SkIRect* data() const;
31 31
32 void reset(Mode = Mode::kExclusive); 32 void reset(Mode = Mode::kExclusive);
33 GrWindowRectangles& operator=(const GrWindowRectangles&); 33 GrWindowRectangles& operator=(const GrWindowRectangles&);
34 34
35 SkIRect& addWindow(const SkIRect& window) { return this->addWindow() = windo w; } 35 SkIRect& addWindow(const SkIRect& window) { return this->addWindow() = windo w; }
36 SkIRect& addWindow(); 36 SkIRect& addWindow();
37 37
38 bool operator!=(const GrWindowRectangles& that) const { return !(*this == th at); } 38 bool operator!=(const GrWindowRectangles& that) const { return !(*this == th at); }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 if (fMode != that.fMode || fCount != that.fCount) { 101 if (fMode != that.fMode || fCount != that.fCount) {
102 return false; 102 return false;
103 } 103 }
104 if (fCount > kNumLocalWindows && fRec == that.fRec) { 104 if (fCount > kNumLocalWindows && fRec == that.fRec) {
105 return true; 105 return true;
106 } 106 }
107 return !fCount || !memcmp(this->data(), that.data(), sizeof(SkIRect) * fCoun t); 107 return !fCount || !memcmp(this->data(), that.data(), sizeof(SkIRect) * fCoun t);
108 } 108 }
109 109
110 #endif 110 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrCaps.cpp ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698