Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: src/core/SkRecorder.cpp

Issue 1992283002: Add drawBitmapLattice() API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add implementation for SkRecorder and SkPictureRecord Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 #ifdef WRAP_BITMAP_AS_IMAGE 219 #ifdef WRAP_BITMAP_AS_IMAGE
220 SkAutoTUnref<SkImage> image(SkImage::NewFromBitmap(bitmap)); 220 SkAutoTUnref<SkImage> image(SkImage::NewFromBitmap(bitmap));
221 if (image) { 221 if (image) {
222 this->onDrawImageNine(image, center, dst, paint); 222 this->onDrawImageNine(image, center, dst, paint);
223 } 223 }
224 #else 224 #else
225 APPEND(DrawBitmapNine, this->copy(paint), bitmap, center, dst); 225 APPEND(DrawBitmapNine, this->copy(paint), bitmap, center, dst);
226 #endif 226 #endif
227 } 227 }
228 228
229 void SkRecorder::onDrawBitmapNine(const SkBitmap& bitmap,
230 const NinePatchDivs& divs,
231 const SkRect& dst,
232 const SkPaint* paint) {
233 APPEND(DrawBitmapNineDivs, this->copy(paint), bitmap,
234 ((const SkNinePatchDivs&) divs).asData(), dst);
235 }
236
229 void SkRecorder::onDrawImage(const SkImage* image, SkScalar left, SkScalar top, 237 void SkRecorder::onDrawImage(const SkImage* image, SkScalar left, SkScalar top,
230 const SkPaint* paint) { 238 const SkPaint* paint) {
231 APPEND(DrawImage, this->copy(paint), image, left, top); 239 APPEND(DrawImage, this->copy(paint), image, left, top);
232 } 240 }
233 241
234 void SkRecorder::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst, 242 void SkRecorder::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst,
235 const SkPaint* paint, SrcRectConstraint constra int) { 243 const SkPaint* paint, SrcRectConstraint constra int) {
236 APPEND(DrawImageRect, this->copy(paint), image, this->copy(src), dst, constr aint); 244 APPEND(DrawImageRect, this->copy(paint), image, this->copy(src), dst, constr aint);
237 } 245 }
238 246
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 } 396 }
389 397
390 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { 398 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
391 INHERITED(onClipRegion, deviceRgn, op); 399 INHERITED(onClipRegion, deviceRgn, op);
392 APPEND(ClipRegion, this->devBounds(), deviceRgn, op); 400 APPEND(ClipRegion, this->devBounds(), deviceRgn, op);
393 } 401 }
394 402
395 sk_sp<SkSurface> SkRecorder::onNewSurface(const SkImageInfo&, const SkSurfacePro ps&) { 403 sk_sp<SkSurface> SkRecorder::onNewSurface(const SkImageInfo&, const SkSurfacePro ps&) {
396 return nullptr; 404 return nullptr;
397 } 405 }
OLDNEW
« include/core/SkCanvas.h ('K') | « src/core/SkRecorder.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698