OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkBBoxRecord.h" | 9 #include "SkBBoxRecord.h" |
10 | 10 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 void SkBBoxRecord::drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar to
p, | 128 void SkBBoxRecord::drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar to
p, |
129 const SkPaint* paint) { | 129 const SkPaint* paint) { |
130 SkRect bbox = {left, top, left + bitmap.width(), top + bitmap.height()}; | 130 SkRect bbox = {left, top, left + bitmap.width(), top + bitmap.height()}; |
131 if (this->transformBounds(bbox, paint)) { | 131 if (this->transformBounds(bbox, paint)) { |
132 INHERITED::drawBitmap(bitmap, left, top, paint); | 132 INHERITED::drawBitmap(bitmap, left, top, paint); |
133 } | 133 } |
134 } | 134 } |
135 | 135 |
136 void SkBBoxRecord::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* sr
c, | 136 void SkBBoxRecord::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* sr
c, |
137 const SkRect& dst, const SkPaint* paint) { | 137 const SkRect& dst, const SkPaint* paint, |
| 138 DrawBitmapRectFlags flags) { |
138 if (this->transformBounds(dst, paint)) { | 139 if (this->transformBounds(dst, paint)) { |
139 INHERITED::drawBitmapRectToRect(bitmap, src, dst, paint); | 140 INHERITED::drawBitmapRectToRect(bitmap, src, dst, paint, flags); |
140 } | 141 } |
141 } | 142 } |
142 | 143 |
143 void SkBBoxRecord::drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& mat, | 144 void SkBBoxRecord::drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& mat, |
144 const SkPaint* paint) { | 145 const SkPaint* paint) { |
145 SkMatrix m = mat; | 146 SkMatrix m = mat; |
146 SkRect bbox = {0, 0, SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.hei
ght())}; | 147 SkRect bbox = {0, 0, SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.hei
ght())}; |
147 m.mapRect(&bbox); | 148 m.mapRect(&bbox); |
148 if (this->transformBounds(bbox, paint)) { | 149 if (this->transformBounds(bbox, paint)) { |
149 INHERITED::drawBitmapMatrix(bitmap, mat, paint); | 150 INHERITED::drawBitmapMatrix(bitmap, mat, paint); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 } | 276 } |
276 | 277 |
277 if (!outBounds.isEmpty() && !this->quickReject(outBounds)) { | 278 if (!outBounds.isEmpty() && !this->quickReject(outBounds)) { |
278 this->getTotalMatrix().mapRect(&outBounds); | 279 this->getTotalMatrix().mapRect(&outBounds); |
279 this->handleBBox(outBounds); | 280 this->handleBBox(outBounds); |
280 return true; | 281 return true; |
281 } | 282 } |
282 | 283 |
283 return false; | 284 return false; |
284 } | 285 } |
OLD | NEW |