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

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

Issue 947443003: Move clip off of draw target (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup Created 5 years, 10 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
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 "GrSurface.h"
11 #include "SkRect.h"
12
13 ///////////////////////////////////////////////////////////////////////////////
14
15 /**
16 * getConservativeBounds returns the conservative bounding box of the clip
17 * in device (as opposed to canvas) coordinates. If the bounding box is
18 * the result of purely intersections of rects (with an initial replace)
19 * isIntersectionOfRects will be set to true.
20 */
21 void GrClip::getConservativeBounds(int width, int height, SkIRect* devResult,
22 bool* isIntersectionOfRects) const {
23 switch (fClipType) {
24 default:
25 SkFAIL("incomplete switch\n");
26 case kWideOpen_ClipType: {
27 devResult->setLTRB(0, 0, SkIntToScalar(width), SkIntToScalar(height) );
28 if (isIntersectionOfRects) {
29 *isIntersectionOfRects = false;
bsalomon 2015/02/23 19:31:29 I think we should say true here... it is effective
30 }
31 } break;
32 case kIRect_ClipType: {
33 *devResult = this->irect();
34 if (isIntersectionOfRects) {
35 *isIntersectionOfRects = false;
bsalomon 2015/02/23 19:31:29 true
36 }
37 } break;
38 case kClipStack_ClipType: {
39 SkRect devBounds;
40 this->clipStack()->getConservativeBounds(-this->origin().fX,
41 -this->origin().fY,
42 width,
43 height,
44 &devBounds,
45 isIntersectionOfRects);
46 devBounds.roundOut(devResult);
47 } break;
48
49 }
50 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698