| 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 #include "SkBigPicture.h" | 8 #include "SkBigPicture.h" |
| 9 #include "SkCanvasPriv.h" | 9 #include "SkCanvasPriv.h" |
| 10 #include "SkPatchUtils.h" | 10 #include "SkPatchUtils.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 } | 179 } |
| 180 #else | 180 #else |
| 181 APPEND(DrawBitmap, this->copy(paint), bitmap, left, top); | 181 APPEND(DrawBitmap, this->copy(paint), bitmap, left, top); |
| 182 #endif | 182 #endif |
| 183 } | 183 } |
| 184 | 184 |
| 185 void SkRecorder::onDrawBitmapRect(const SkBitmap& bitmap, | 185 void SkRecorder::onDrawBitmapRect(const SkBitmap& bitmap, |
| 186 const SkRect* src, | 186 const SkRect* src, |
| 187 const SkRect& dst, | 187 const SkRect& dst, |
| 188 const SkPaint* paint, | 188 const SkPaint* paint, |
| 189 SK_VIRTUAL_CONSTRAINT_TYPE legacyConstraint) { | 189 SrcRectConstraint constraint) { |
| 190 SrcRectConstraint constraint = (SrcRectConstraint)legacyConstraint; | |
| 191 | |
| 192 #ifdef WRAP_BITMAP_AS_IMAGE | 190 #ifdef WRAP_BITMAP_AS_IMAGE |
| 193 // TODO: need a way to support the flags for images... | 191 // TODO: need a way to support the flags for images... |
| 194 SkAutoTUnref<SkImage> image(SkImage::NewFromBitmap(bitmap)); | 192 SkAutoTUnref<SkImage> image(SkImage::NewFromBitmap(bitmap)); |
| 195 if (image) { | 193 if (image) { |
| 196 this->onDrawImageRect(image, src, dst, paint); | 194 this->onDrawImageRect(image, src, dst, paint); |
| 197 } | 195 } |
| 198 #else | 196 #else |
| 199 TRY_MINIRECORDER(drawBitmapRect, bitmap, src, dst, paint, constraint); | 197 TRY_MINIRECORDER(drawBitmapRect, bitmap, src, dst, paint, constraint); |
| 200 if (kFast_SrcRectConstraint == constraint) { | 198 if (kFast_SrcRectConstraint == constraint) { |
| 201 APPEND(DrawBitmapRectFast, this->copy(paint), bitmap, this->copy(src), d
st); | 199 APPEND(DrawBitmapRectFast, this->copy(paint), bitmap, this->copy(src), d
st); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 218 #else | 216 #else |
| 219 APPEND(DrawBitmapNine, this->copy(paint), bitmap, center, dst); | 217 APPEND(DrawBitmapNine, this->copy(paint), bitmap, center, dst); |
| 220 #endif | 218 #endif |
| 221 } | 219 } |
| 222 | 220 |
| 223 void SkRecorder::onDrawImage(const SkImage* image, SkScalar left, SkScalar top, | 221 void SkRecorder::onDrawImage(const SkImage* image, SkScalar left, SkScalar top, |
| 224 const SkPaint* paint) { | 222 const SkPaint* paint) { |
| 225 APPEND(DrawImage, this->copy(paint), image, left, top); | 223 APPEND(DrawImage, this->copy(paint), image, left, top); |
| 226 } | 224 } |
| 227 | 225 |
| 228 void SkRecorder::onDrawImageRect(const SkImage* image, const SkRect* src, | 226 void SkRecorder::onDrawImageRect(const SkImage* image, const SkRect* src, const
SkRect& dst, |
| 229 const SkRect& dst, | 227 const SkPaint* paint, SrcRectConstraint constra
int) { |
| 230 const SkPaint* paint SRC_RECT_CONSTRAINT_PARAM(
constraint)) { | |
| 231 #ifdef SK_SUPPORT_LEGACY_ONDRAWIMAGERECT | |
| 232 SrcRectConstraint constraint = kStrict_SrcRectConstraint; | |
| 233 #endif | |
| 234 APPEND(DrawImageRect, this->copy(paint), image, this->copy(src), dst, constr
aint); | 228 APPEND(DrawImageRect, this->copy(paint), image, this->copy(src), dst, constr
aint); |
| 235 } | 229 } |
| 236 | 230 |
| 237 void SkRecorder::onDrawImageNine(const SkImage* image, const SkIRect& center, | 231 void SkRecorder::onDrawImageNine(const SkImage* image, const SkIRect& center, |
| 238 const SkRect& dst, const SkPaint* paint) { | 232 const SkRect& dst, const SkPaint* paint) { |
| 239 APPEND(DrawImageNine, this->copy(paint), image, center, dst); | 233 APPEND(DrawImageNine, this->copy(paint), image, center, dst); |
| 240 } | 234 } |
| 241 | 235 |
| 242 void SkRecorder::onDrawSprite(const SkBitmap& bitmap, int left, int top, const S
kPaint* paint) { | 236 void SkRecorder::onDrawSprite(const SkBitmap& bitmap, int left, int top, const S
kPaint* paint) { |
| 243 APPEND(DrawSprite, this->copy(paint), bitmap, left, top); | 237 APPEND(DrawSprite, this->copy(paint), bitmap, left, top); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 INHERITED(onClipPath, path, op, edgeStyle); | 373 INHERITED(onClipPath, path, op, edgeStyle); |
| 380 SkRecords::RegionOpAndAA opAA(op, kSoft_ClipEdgeStyle == edgeStyle); | 374 SkRecords::RegionOpAndAA opAA(op, kSoft_ClipEdgeStyle == edgeStyle); |
| 381 APPEND(ClipPath, this->devBounds(), path, opAA); | 375 APPEND(ClipPath, this->devBounds(), path, opAA); |
| 382 } | 376 } |
| 383 | 377 |
| 384 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { | 378 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { |
| 385 INHERITED(onClipRegion, deviceRgn, op); | 379 INHERITED(onClipRegion, deviceRgn, op); |
| 386 APPEND(ClipRegion, this->devBounds(), deviceRgn, op); | 380 APPEND(ClipRegion, this->devBounds(), deviceRgn, op); |
| 387 } | 381 } |
| 388 | 382 |
| OLD | NEW |