| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 const SkRect& dst, | 195 const SkRect& dst, |
| 196 const SkPaint* paint, | 196 const SkPaint* paint, |
| 197 SrcRectConstraint constraint) { | 197 SrcRectConstraint constraint) { |
| 198 #ifdef WRAP_BITMAP_AS_IMAGE | 198 #ifdef WRAP_BITMAP_AS_IMAGE |
| 199 // TODO: need a way to support the flags for images... | 199 // TODO: need a way to support the flags for images... |
| 200 SkAutoTUnref<SkImage> image(SkImage::NewFromBitmap(bitmap)); | 200 SkAutoTUnref<SkImage> image(SkImage::NewFromBitmap(bitmap)); |
| 201 if (image) { | 201 if (image) { |
| 202 this->onDrawImageRect(image, src, dst, paint); | 202 this->onDrawImageRect(image, src, dst, paint); |
| 203 } | 203 } |
| 204 #else | 204 #else |
| 205 TRY_MINIRECORDER(drawBitmapRect, bitmap, src, dst, paint, constraint); | |
| 206 if (kFast_SrcRectConstraint == constraint) { | 205 if (kFast_SrcRectConstraint == constraint) { |
| 207 APPEND(DrawBitmapRectFast, this->copy(paint), bitmap, this->copy(src), d
st); | 206 APPEND(DrawBitmapRectFast, this->copy(paint), bitmap, this->copy(src), d
st); |
| 208 return; | 207 return; |
| 209 } | 208 } |
| 210 SkASSERT(kStrict_SrcRectConstraint == constraint); | 209 SkASSERT(kStrict_SrcRectConstraint == constraint); |
| 211 APPEND(DrawBitmapRect, this->copy(paint), bitmap, this->copy(src), dst); | 210 APPEND(DrawBitmapRect, this->copy(paint), bitmap, this->copy(src), dst); |
| 212 #endif | 211 #endif |
| 213 } | 212 } |
| 214 | 213 |
| 215 void SkRecorder::onDrawBitmapNine(const SkBitmap& bitmap, | 214 void SkRecorder::onDrawBitmapNine(const SkBitmap& bitmap, |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 } | 407 } |
| 409 | 408 |
| 410 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { | 409 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { |
| 411 INHERITED(onClipRegion, deviceRgn, op); | 410 INHERITED(onClipRegion, deviceRgn, op); |
| 412 APPEND(ClipRegion, this->devBounds(), deviceRgn, op); | 411 APPEND(ClipRegion, this->devBounds(), deviceRgn, op); |
| 413 } | 412 } |
| 414 | 413 |
| 415 sk_sp<SkSurface> SkRecorder::onNewSurface(const SkImageInfo&, const SkSurfacePro
ps&) { | 414 sk_sp<SkSurface> SkRecorder::onNewSurface(const SkImageInfo&, const SkSurfacePro
ps&) { |
| 416 return nullptr; | 415 return nullptr; |
| 417 } | 416 } |
| OLD | NEW |