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

Side by Side Diff: src/gpu/GrScissorState.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/GrRenderTargetPriv.h ('k') | src/gpu/GrWindowRectangles.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 GrScissorState_DEFINED
9 #define GrScissorState_DEFINED
10
11 #include "SkRect.h"
12
13 class GrScissorState {
14 public:
15 GrScissorState() : fEnabled(false) {}
16 GrScissorState(const SkIRect& rect) : fEnabled(true), fRect(rect) {}
17 void setDisabled() { fEnabled = false; }
18 void set(const SkIRect& rect) { fRect = rect; fEnabled = true; }
19 bool SK_WARN_UNUSED_RESULT intersect(const SkIRect& rect) {
20 if (!fEnabled) {
21 this->set(rect);
22 return true;
23 }
24 return fRect.intersect(rect);
25 }
26 bool operator==(const GrScissorState& other) const {
27 return fEnabled == other.fEnabled &&
28 (false == fEnabled || fRect == other.fRect);
29 }
30 bool operator!=(const GrScissorState& other) const { return !(*this == other ); }
31
32 bool enabled() const { return fEnabled; }
33 const SkIRect& rect() const { return fRect; }
34
35 private:
36 bool fEnabled;
37 SkIRect fRect;
38 };
39
40 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrRenderTargetPriv.h ('k') | src/gpu/GrWindowRectangles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698