| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 #include "GrClip.h" | 8 #include "GrClip.h" |
| 9 | 9 |
| 10 #include "GrSurface.h" | 10 #include "GrSurface.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 if (isIntersectionOfRects) { | 26 if (isIntersectionOfRects) { |
| 27 *isIntersectionOfRects = true; | 27 *isIntersectionOfRects = true; |
| 28 } | 28 } |
| 29 } break; | 29 } break; |
| 30 case kIRect_ClipType: { | 30 case kIRect_ClipType: { |
| 31 *devResult = this->irect(); | 31 *devResult = this->irect(); |
| 32 if (isIntersectionOfRects) { | 32 if (isIntersectionOfRects) { |
| 33 *isIntersectionOfRects = true; | 33 *isIntersectionOfRects = true; |
| 34 } | 34 } |
| 35 } break; | 35 } break; |
| 36 case kRect_ClipType: { | |
| 37 devResult->setLTRB(SkScalarCeilToInt(this->rect().fLeft), | |
| 38 SkScalarCeilToInt(this->rect().fTop), | |
| 39 SkScalarCeilToInt(this->rect().fRight), | |
| 40 SkScalarCeilToInt(this->rect().fBottom)); | |
| 41 if (isIntersectionOfRects) { | |
| 42 *isIntersectionOfRects = true; | |
| 43 } | |
| 44 } break; | |
| 45 case kClipStack_ClipType: { | 36 case kClipStack_ClipType: { |
| 46 SkRect devBounds; | 37 SkRect devBounds; |
| 47 this->clipStack()->getConservativeBounds(-this->origin().fX, | 38 this->clipStack()->getConservativeBounds(-this->origin().fX, |
| 48 -this->origin().fY, | 39 -this->origin().fY, |
| 49 width, | 40 width, |
| 50 height, | 41 height, |
| 51 &devBounds, | 42 &devBounds, |
| 52 isIntersectionOfRects); | 43 isIntersectionOfRects); |
| 53 devBounds.roundOut(devResult); | 44 devBounds.roundOut(devResult); |
| 54 } break; | 45 } break; |
| 55 | 46 |
| 56 } | 47 } |
| 57 } | 48 } |
| 58 | 49 |
| 59 const GrClip& GrClip::WideOpen() { | 50 const GrClip& GrClip::WideOpen() { |
| 60 static const GrClip clip; | 51 static const GrClip clip; |
| 61 return clip; | 52 return clip; |
| 62 } | 53 } |
| OLD | NEW |