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

Side by Side Diff: src/core/SkDevice.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/SkCanvas.cpp ('k') | src/core/SkLatticeIter.h » ('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 2011 Google Inc. 2 * Copyright 2011 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 "SkColorFilter.h" 8 #include "SkColorFilter.h"
9 #include "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkDraw.h" 10 #include "SkDraw.h"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 212
213 SkRect srcR, dstR; 213 SkRect srcR, dstR;
214 while (iter.next(&srcR, &dstR)) { 214 while (iter.next(&srcR, &dstR)) {
215 this->drawBitmapRect(draw, bitmap, &srcR, dstR, paint, SkCanvas::kStrict _SrcRectConstraint); 215 this->drawBitmapRect(draw, bitmap, &srcR, dstR, paint, SkCanvas::kStrict _SrcRectConstraint);
216 } 216 }
217 } 217 }
218 218
219 void SkBaseDevice::drawImageLattice(const SkDraw& draw, const SkImage* image, 219 void SkBaseDevice::drawImageLattice(const SkDraw& draw, const SkImage* image,
220 const SkCanvas::Lattice& lattice, const SkRe ct& dst, 220 const SkCanvas::Lattice& lattice, const SkRe ct& dst,
221 const SkPaint& paint) { 221 const SkPaint& paint) {
222 SkLatticeIter iter(image->width(), image->height(), lattice, dst); 222 SkLatticeIter iter(lattice, dst);
223 223
224 SkRect srcR, dstR; 224 SkRect srcR, dstR;
225 while (iter.next(&srcR, &dstR)) { 225 while (iter.next(&srcR, &dstR)) {
226 this->drawImageRect(draw, image, &srcR, dstR, paint, SkCanvas::kStrict_S rcRectConstraint); 226 this->drawImageRect(draw, image, &srcR, dstR, paint, SkCanvas::kStrict_S rcRectConstraint);
227 } 227 }
228 } 228 }
229 229
230 void SkBaseDevice::drawBitmapLattice(const SkDraw& draw, const SkBitmap& bitmap, 230 void SkBaseDevice::drawBitmapLattice(const SkDraw& draw, const SkBitmap& bitmap,
231 const SkCanvas::Lattice& lattice, const SkR ect& dst, 231 const SkCanvas::Lattice& lattice, const SkR ect& dst,
232 const SkPaint& paint) { 232 const SkPaint& paint) {
233 SkLatticeIter iter(bitmap.width(), bitmap.height(), lattice, dst); 233 SkLatticeIter iter(lattice, dst);
234 234
235 SkRect srcR, dstR; 235 SkRect srcR, dstR;
236 while (iter.next(&srcR, &dstR)) { 236 while (iter.next(&srcR, &dstR)) {
237 this->drawBitmapRect(draw, bitmap, &srcR, dstR, paint, SkCanvas::kStrict _SrcRectConstraint); 237 this->drawBitmapRect(draw, bitmap, &srcR, dstR, paint, SkCanvas::kStrict _SrcRectConstraint);
238 } 238 }
239 } 239 }
240 240
241 void SkBaseDevice::drawAtlas(const SkDraw& draw, const SkImage* atlas, const SkR SXform xform[], 241 void SkBaseDevice::drawAtlas(const SkDraw& draw, const SkImage* atlas, const SkR SXform xform[],
242 const SkRect tex[], const SkColor colors[], int cou nt, 242 const SkRect tex[], const SkColor colors[], int cou nt,
243 SkXfermode::Mode mode, const SkPaint& paint) { 243 SkXfermode::Mode mode, const SkPaint& paint) {
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 568
569 // Also log filter quality independent scale factor. 569 // Also log filter quality independent scale factor.
570 SK_HISTOGRAM_ENUMERATION("DrawScaleFactor.AnyFilterQuality", scaleFactor, 570 SK_HISTOGRAM_ENUMERATION("DrawScaleFactor.AnyFilterQuality", scaleFactor,
571 kLast_ScaleFactor + 1); 571 kLast_ScaleFactor + 1);
572 572
573 // Also log an overall histogram of filter quality. 573 // Also log an overall histogram of filter quality.
574 SK_HISTOGRAM_ENUMERATION("FilterQuality", filterQuality, kLast_SkFilterQuali ty + 1); 574 SK_HISTOGRAM_ENUMERATION("FilterQuality", filterQuality, kLast_SkFilterQuali ty + 1);
575 #endif 575 #endif
576 } 576 }
577 577
OLDNEW
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkLatticeIter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698