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

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

Issue 2312173002: Revert of Improve usage of window rectangles (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_drawsinreducedclip
Patch Set: Created 4 years, 3 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/GrWindowRectangles.h ('k') | src/gpu/batches/GrClearBatch.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef GrWindowRectsState_DEFINED
9 #define GrWindowRectsState_DEFINED
10
11 #include "GrWindowRectangles.h"
12
13 class GrWindowRectsState {
14 public:
15 enum class Mode : bool {
16 kExclusive,
17 kInclusive
18 };
19
20 GrWindowRectsState() : fMode(Mode::kExclusive) {}
21 GrWindowRectsState(const GrWindowRectangles& windows, const SkIPoint& origin , Mode mode)
22 : fMode(mode)
23 , fOrigin(origin)
24 , fWindows(windows) {
25 }
26
27 bool enabled() const { return Mode::kInclusive == fMode || !fWindows.empty() ; }
28 Mode mode() const { return fMode; }
29 const SkIPoint& origin() const { return fOrigin; }
30 const GrWindowRectangles& windows() const { return fWindows; }
31 int numWindows() const { return fWindows.count(); }
32
33 void setDisabled() {
34 fMode = Mode::kExclusive;
35 fWindows.reset();
36 }
37
38 void set(const GrWindowRectangles& windows, const SkIPoint& origin, Mode mod e) {
39 fMode = mode;
40 fOrigin = origin;
41 fWindows = windows;
42 }
43
44 bool cheapEqualTo(const GrWindowRectsState& that) const {
45 if (fMode != that.fMode) {
46 return false;
47 }
48 if (!fWindows.empty() && fOrigin != that.fOrigin) {
49 return false;
50 }
51 return fWindows == that.fWindows;
52 }
53
54 private:
55 Mode fMode;
56 SkIPoint fOrigin;
57 GrWindowRectangles fWindows;
58 };
59
60 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrWindowRectangles.h ('k') | src/gpu/batches/GrClearBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698