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

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

Issue 2254343003: Move GrFixedClip into src directory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/GrDrawContext.cpp ('k') | src/gpu/GrFixedClip.cpp » ('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 GrFixedClip_DEFINED
9 #define GrFixedClip_DEFINED
10
11 #include "GrClip.h"
12 #include "GrTypesPriv.h"
13
14 /**
15 * GrFixedClip is a clip that can be represented by fixed-function hardware. It never modifies the
16 * stencil buffer itself, but can be configured to use whatever clip is already there.
17 */
18 class GrFixedClip final : public GrClip {
19 public:
20 GrFixedClip() : fHasStencilClip(false) {}
21 GrFixedClip(const SkIRect& scissorRect)
22 : fScissorState(scissorRect)
23 , fHasStencilClip(false) {}
24
25 void reset() {
26 fScissorState.setDisabled();
27 fHasStencilClip = false;
28 }
29
30 void reset(const SkIRect& scissorRect) {
31 fScissorState.set(scissorRect);
32 fHasStencilClip = false;
33 }
34
35 void enableStencilClip() { fHasStencilClip = true; }
36 void disableStencilClip() { fHasStencilClip = false; }
37
38 bool quickContains(const SkRect&) const final;
39 void getConservativeBounds(int width, int height, SkIRect* devResult,
40 bool* isIntersectionOfRects) const final;
41
42 private:
43 bool apply(GrContext*, GrDrawContext*, bool useHWAA, bool hasUserStencilSett ings,
44 GrAppliedClip* out) const final;
45
46 GrScissorState fScissorState;
47 bool fHasStencilClip;
48 };
49
50 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | src/gpu/GrFixedClip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698