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

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

Issue 2382893002: Add a src rect to drawImageLattice() API (Closed)
Patch Set: Simplify impl Created 4 years, 2 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
« no previous file with comments | « src/core/SkRecordDraw.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "SkImage.h" 10 #include "SkImage.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 } 232 }
233 233
234 void SkRecorder::onDrawImageNine(const SkImage* image, const SkIRect& center, 234 void SkRecorder::onDrawImageNine(const SkImage* image, const SkIRect& center,
235 const SkRect& dst, const SkPaint* paint) { 235 const SkRect& dst, const SkPaint* paint) {
236 APPEND(DrawImageNine, this->copy(paint), sk_ref_sp(image), center, dst); 236 APPEND(DrawImageNine, this->copy(paint), sk_ref_sp(image), center, dst);
237 } 237 }
238 238
239 void SkRecorder::onDrawImageLattice(const SkImage* image, const Lattice& lattice , const SkRect& dst, 239 void SkRecorder::onDrawImageLattice(const SkImage* image, const Lattice& lattice , const SkRect& dst,
240 const SkPaint* paint) { 240 const SkPaint* paint) {
241 int flagCount = lattice.fFlags ? (lattice.fXCount + 1) * (lattice.fYCount + 1) : 0; 241 int flagCount = lattice.fFlags ? (lattice.fXCount + 1) * (lattice.fYCount + 1) : 0;
242 SkASSERT(lattice.fBounds);
242 APPEND(DrawImageLattice, this->copy(paint), sk_ref_sp(image), 243 APPEND(DrawImageLattice, this->copy(paint), sk_ref_sp(image),
243 lattice.fXCount, this->copy(lattice.fXDivs, lattice.fXCount), 244 lattice.fXCount, this->copy(lattice.fXDivs, lattice.fXCount),
244 lattice.fYCount, this->copy(lattice.fYDivs, lattice.fYCount), 245 lattice.fYCount, this->copy(lattice.fYDivs, lattice.fYCount),
245 flagCount, this->copy(lattice.fFlags, flagCount), dst); 246 flagCount, this->copy(lattice.fFlags, flagCount), *lattice.fBounds, d st);
246 } 247 }
247 248
248 void SkRecorder::onDrawText(const void* text, size_t byteLength, 249 void SkRecorder::onDrawText(const void* text, size_t byteLength,
249 SkScalar x, SkScalar y, const SkPaint& paint) { 250 SkScalar x, SkScalar y, const SkPaint& paint) {
250 APPEND(DrawText, 251 APPEND(DrawText,
251 paint, this->copy((const char*)text, byteLength), byteLength, x, y); 252 paint, this->copy((const char*)text, byteLength), byteLength, x, y);
252 } 253 }
253 254
254 void SkRecorder::onDrawPosText(const void* text, size_t byteLength, 255 void SkRecorder::onDrawPosText(const void* text, size_t byteLength,
255 const SkPoint pos[], const SkPaint& paint) { 256 const SkPoint pos[], const SkPaint& paint) {
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 } 422 }
422 423
423 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, ClipOp op) { 424 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, ClipOp op) {
424 INHERITED(onClipRegion, deviceRgn, op); 425 INHERITED(onClipRegion, deviceRgn, op);
425 APPEND(ClipRegion, this->devBounds(), deviceRgn, op); 426 APPEND(ClipRegion, this->devBounds(), deviceRgn, op);
426 } 427 }
427 428
428 sk_sp<SkSurface> SkRecorder::onNewSurface(const SkImageInfo&, const SkSurfacePro ps&) { 429 sk_sp<SkSurface> SkRecorder::onNewSurface(const SkImageInfo&, const SkSurfacePro ps&) {
429 return nullptr; 430 return nullptr;
430 } 431 }
OLDNEW
« no previous file with comments | « src/core/SkRecordDraw.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698