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

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

Issue 2271053004: Convert drawPaint to drawRRect in simple cases (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: fix another msvs warning 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/GrDrawContext.cpp ('k') | no next file » | 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 GrFixedClip_DEFINED 8 #ifndef GrFixedClip_DEFINED
9 #define GrFixedClip_DEFINED 9 #define GrFixedClip_DEFINED
10 10
(...skipping 21 matching lines...) Expand all
32 fHasStencilClip = false; 32 fHasStencilClip = false;
33 } 33 }
34 34
35 void enableStencilClip() { fHasStencilClip = true; } 35 void enableStencilClip() { fHasStencilClip = true; }
36 void disableStencilClip() { fHasStencilClip = false; } 36 void disableStencilClip() { fHasStencilClip = false; }
37 37
38 bool quickContains(const SkRect&) const final; 38 bool quickContains(const SkRect&) const final;
39 void getConservativeBounds(int width, int height, SkIRect* devResult, 39 void getConservativeBounds(int width, int height, SkIRect* devResult,
40 bool* isIntersectionOfRects) const final; 40 bool* isIntersectionOfRects) const final;
41 41
42 bool isRRect(const SkRect& rtBounds, SkRRect* rr, bool* aa) const override {
43 if (fHasStencilClip) {
44 return false;
45 }
46 if (fScissorState.enabled()) {
47 SkRect rect = SkRect::Make(fScissorState.rect());
48 if (!rect.intersects(rtBounds)) {
49 return false;
50 }
51 rr->setRect(rect);
52 *aa = false;
53 return true;
54 }
55 return false;
56 };
57
42 private: 58 private:
43 bool apply(GrContext*, GrDrawContext*, bool useHWAA, bool hasUserStencilSett ings, 59 bool apply(GrContext*, GrDrawContext*, bool useHWAA, bool hasUserStencilSett ings,
44 GrAppliedClip* out) const final; 60 GrAppliedClip* out) const final;
45 61
46 GrScissorState fScissorState; 62 GrScissorState fScissorState;
47 bool fHasStencilClip; 63 bool fHasStencilClip;
48 }; 64 };
49 65
50 #endif 66 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698