| OLD | NEW |
| 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 #include "GrClipStackClip.h" | 8 #include "GrClipStackClip.h" |
| 9 | 9 |
| 10 #include "GrDrawingManager.h" | 10 #include "GrDrawingManager.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 static const int kMaxAnalyticElements = 4; | 23 static const int kMaxAnalyticElements = 4; |
| 24 | 24 |
| 25 bool GrClipStackClip::quickContains(const SkRect& rect) const { | 25 bool GrClipStackClip::quickContains(const SkRect& rect) const { |
| 26 if (!fStack) { | 26 if (!fStack) { |
| 27 return true; | 27 return true; |
| 28 } | 28 } |
| 29 return fStack->quickContains(rect.makeOffset(SkIntToScalar(fOrigin.x()), | 29 return fStack->quickContains(rect.makeOffset(SkIntToScalar(fOrigin.x()), |
| 30 SkIntToScalar(fOrigin.y()))); | 30 SkIntToScalar(fOrigin.y()))); |
| 31 } | 31 } |
| 32 | 32 |
| 33 bool GrClipStackClip::quickContains(const SkRRect& rrect) const { |
| 34 if (!fStack) { |
| 35 return true; |
| 36 } |
| 37 return fStack->quickContains(rrect.makeOffset(SkIntToScalar(fOrigin.fX), |
| 38 SkIntToScalar(fOrigin.fY))); |
| 39 } |
| 40 |
| 33 void GrClipStackClip::getConservativeBounds(int width, int height, SkIRect* devR
esult, | 41 void GrClipStackClip::getConservativeBounds(int width, int height, SkIRect* devR
esult, |
| 34 bool* isIntersectionOfRects) const { | 42 bool* isIntersectionOfRects) const { |
| 35 if (!fStack) { | 43 if (!fStack) { |
| 36 devResult->setXYWH(0, 0, width, height); | 44 devResult->setXYWH(0, 0, width, height); |
| 37 if (isIntersectionOfRects) { | 45 if (isIntersectionOfRects) { |
| 38 *isIntersectionOfRects = true; | 46 *isIntersectionOfRects = true; |
| 39 } | 47 } |
| 40 return; | 48 return; |
| 41 } | 49 } |
| 42 SkRect devBounds; | 50 SkRect devBounds; |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 sk_sp<GrTexture> result(texProvider->createApproxTexture(desc)); | 763 sk_sp<GrTexture> result(texProvider->createApproxTexture(desc)); |
| 756 if (!result) { | 764 if (!result) { |
| 757 return nullptr; | 765 return nullptr; |
| 758 } | 766 } |
| 759 result->resourcePriv().setUniqueKey(key); | 767 result->resourcePriv().setUniqueKey(key); |
| 760 | 768 |
| 761 helper.toTexture(result.get()); | 769 helper.toTexture(result.get()); |
| 762 | 770 |
| 763 return result; | 771 return result; |
| 764 } | 772 } |
| OLD | NEW |