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

Side by Side Diff: src/pdf/SkPDFCanvas.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/gpu/SkGpuDevice.cpp ('k') | src/pipe/SkPipeCanvas.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 2016 Google Inc. 2 * Copyright 2016 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 "SkLatticeIter.h" 8 #include "SkLatticeIter.h"
9 #include "SkPDFCanvas.h" 9 #include "SkPDFCanvas.h"
10 #include "SkPDFDevice.h" 10 #include "SkPDFDevice.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 this->concat(SkMatrix::MakeRectToRect(src, dst, 83 this->concat(SkMatrix::MakeRectToRect(src, dst,
84 SkMatrix::kFill_ScaleToFit)); 84 SkMatrix::kFill_ScaleToFit));
85 this->drawBitmap(bitmap, 0, 0, paint); 85 this->drawBitmap(bitmap, 0, 0, paint);
86 } 86 }
87 87
88 void SkPDFCanvas::onDrawImageLattice(const SkImage* image, 88 void SkPDFCanvas::onDrawImageLattice(const SkImage* image,
89 const Lattice& lattice, 89 const Lattice& lattice,
90 const SkRect& dst, 90 const SkRect& dst,
91 const SkPaint* paint) { 91 const SkPaint* paint) {
92 SkLatticeIter iter(image->width(), image->height(), lattice, dst); 92 SkLatticeIter iter(lattice, dst);
93 SkRect srcR, dstR; 93 SkRect srcR, dstR;
94 while (iter.next(&srcR, &dstR)) { 94 while (iter.next(&srcR, &dstR)) {
95 this->drawImageRect(image, srcR, dstR, paint); 95 this->drawImageRect(image, srcR, dstR, paint);
96 } 96 }
97 } 97 }
98 98
99 void SkPDFCanvas::onDrawBitmapLattice(const SkBitmap& bitmap, 99 void SkPDFCanvas::onDrawBitmapLattice(const SkBitmap& bitmap,
100 const Lattice& lattice, 100 const Lattice& lattice,
101 const SkRect& dst, 101 const SkRect& dst,
102 const SkPaint* paint) { 102 const SkPaint* paint) {
103 SkLatticeIter iter(bitmap.width(), bitmap.height(), lattice, dst); 103 SkLatticeIter iter(lattice, dst);
104 SkRect srcR, dstR; 104 SkRect srcR, dstR;
105 while (iter.next(&srcR, &dstR)) { 105 while (iter.next(&srcR, &dstR)) {
106 this->drawBitmapRect(bitmap, srcR, dstR, paint); 106 this->drawBitmapRect(bitmap, srcR, dstR, paint);
107 } 107 }
108 } 108 }
109 109
OLDNEW
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/pipe/SkPipeCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698