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

Side by Side Diff: src/gpu/GrClip.cpp

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/GrBlurUtils.cpp ('k') | src/gpu/GrClipStackClip.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 2010 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 #include "GrClip.h"
9
10 #include "GrAppliedClip.h"
11 #include "GrDrawContext.h"
12
13 void GrNoClip::getConservativeBounds(int width, int height, SkIRect* devResult,
14 bool* isIntersectionOfRects) const {
15 devResult->setXYWH(0, 0, width, height);
16 if (isIntersectionOfRects) {
17 *isIntersectionOfRects = true;
18 }
19 }
20
21 bool GrFixedClip::quickContains(const SkRect& rect) const {
22 if (fHasStencilClip) {
23 return false;
24 }
25 return !fScissorState.enabled() || GrClip::IsInsideClip(fScissorState.rect() , rect);
26 }
27
28 void GrFixedClip::getConservativeBounds(int width, int height, SkIRect* devResul t,
29 bool* isIntersectionOfRects) const {
30 devResult->setXYWH(0, 0, width, height);
31 if (fScissorState.enabled()) {
32 if (!devResult->intersect(fScissorState.rect())) {
33 devResult->setEmpty();
34 }
35 }
36 if (isIntersectionOfRects) {
37 *isIntersectionOfRects = true;
38 }
39 }
40
41 bool GrFixedClip::apply(GrContext*, GrDrawContext* drawContext, bool isHWAntiAli as,
42 bool hasUserStencilSettings, GrAppliedClip* out) const {
43 if (fScissorState.enabled()) {
44 SkIRect tightScissor;
45 if (!tightScissor.intersect(fScissorState.rect(),
46 SkIRect::MakeWH(drawContext->width(), drawCo ntext->height()))) {
47 return false;
48 }
49 if (IsOutsideClip(tightScissor, out->clippedDrawBounds())) {
50 return false;
51 }
52 if (!IsInsideClip(fScissorState.rect(), out->clippedDrawBounds())) {
53 out->addScissor(tightScissor);
54 }
55 }
56
57 if (fHasStencilClip) {
58 out->addStencilClip();
59 }
60
61 return true;
62 }
OLDNEW
« no previous file with comments | « src/gpu/GrBlurUtils.cpp ('k') | src/gpu/GrClipStackClip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698