OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 SkGatherPixelRefsAndRects_DEFINED | 8 #ifndef SkGatherPixelRefsAndRects_DEFINED |
9 #define SkGatherPixelRefsAndRects_DEFINED | 9 #define SkGatherPixelRefsAndRects_DEFINED |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 this->drawRect(draw, bounds, paint); | 73 this->drawRect(draw, bounds, paint); |
74 } | 74 } |
75 virtual void drawRect(const SkDraw& draw, const SkRect& rect, | 75 virtual void drawRect(const SkDraw& draw, const SkRect& rect, |
76 const SkPaint& paint) SK_OVERRIDE { | 76 const SkPaint& paint) SK_OVERRIDE { |
77 SkBitmap bm; | 77 SkBitmap bm; |
78 if (GetBitmapFromPaint(paint, &bm)) { | 78 if (GetBitmapFromPaint(paint, &bm)) { |
79 SkRect mappedRect; | 79 SkRect mappedRect; |
80 draw.fMatrix->mapRect(&mappedRect, rect); | 80 draw.fMatrix->mapRect(&mappedRect, rect); |
81 SkRect clipRect = SkRect::Make(draw.fRC->getBounds()); | 81 SkRect clipRect = SkRect::Make(draw.fRC->getBounds()); |
82 mappedRect.intersect(clipRect); | 82 if (mappedRect.intersect(clipRect)) { |
83 fPRCont->add(bm.pixelRef(), mappedRect); | 83 fPRCont->add(bm.pixelRef(), mappedRect); |
| 84 } |
84 } | 85 } |
85 } | 86 } |
86 virtual void drawOval(const SkDraw& draw, const SkRect& rect, | 87 virtual void drawOval(const SkDraw& draw, const SkRect& rect, |
87 const SkPaint& paint) SK_OVERRIDE { | 88 const SkPaint& paint) SK_OVERRIDE { |
88 this->drawRect(draw, rect, paint); | 89 this->drawRect(draw, rect, paint); |
89 } | 90 } |
90 virtual void drawRRect(const SkDraw& draw, const SkRRect& rrect, | 91 virtual void drawRRect(const SkDraw& draw, const SkRRect& rrect, |
91 const SkPaint& paint) SK_OVERRIDE { | 92 const SkPaint& paint) SK_OVERRIDE { |
92 this->drawRect(draw, rrect.rect(), paint); | 93 this->drawRect(draw, rrect.rect(), paint); |
93 } | 94 } |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 static void NotSupported() { | 310 static void NotSupported() { |
310 SkDEBUGFAIL("this method should never be called"); | 311 SkDEBUGFAIL("this method should never be called"); |
311 } | 312 } |
312 | 313 |
313 static void NothingToDo() {} | 314 static void NothingToDo() {} |
314 | 315 |
315 typedef SkBaseDevice INHERITED; | 316 typedef SkBaseDevice INHERITED; |
316 }; | 317 }; |
317 | 318 |
318 #endif // SkGatherPixelRefsAndRects_DEFINED | 319 #endif // SkGatherPixelRefsAndRects_DEFINED |
OLD | NEW |