OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 The Android Open Source Project |
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 "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkCanvasPriv.h" | 9 #include "SkCanvasPriv.h" |
10 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 return false; | 63 return false; |
64 } | 64 } |
65 | 65 |
66 if (rect) { | 66 if (rect) { |
67 if (!this->getTotalMatrix().rectStaysRect()) { | 67 if (!this->getTotalMatrix().rectStaysRect()) { |
68 return false; // conservative | 68 return false; // conservative |
69 } | 69 } |
70 | 70 |
71 SkRect devRect; | 71 SkRect devRect; |
72 this->getTotalMatrix().mapRect(&devRect, *rect); | 72 this->getTotalMatrix().mapRect(&devRect, *rect); |
73 if (devRect.contains(bounds)) { | 73 if (!devRect.contains(bounds)) { |
74 return false; | 74 return false; |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
78 if (paint) { | 78 if (paint) { |
79 SkPaint::Style paintStyle = paint->getStyle(); | 79 SkPaint::Style paintStyle = paint->getStyle(); |
80 if (!(paintStyle == SkPaint::kFill_Style || | 80 if (!(paintStyle == SkPaint::kFill_Style || |
81 paintStyle == SkPaint::kStrokeAndFill_Style)) { | 81 paintStyle == SkPaint::kStrokeAndFill_Style)) { |
82 return false; | 82 return false; |
83 } | 83 } |
(...skipping 2782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2866 } | 2866 } |
2867 | 2867 |
2868 if (matrix) { | 2868 if (matrix) { |
2869 canvas->concat(*matrix); | 2869 canvas->concat(*matrix); |
2870 } | 2870 } |
2871 } | 2871 } |
2872 | 2872 |
2873 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 2873 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
2874 fCanvas->restoreToCount(fSaveCount); | 2874 fCanvas->restoreToCount(fSaveCount); |
2875 } | 2875 } |
OLD | NEW |