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

Side by Side Diff: src/pdf/SkPDFCanvas.cpp

Issue 2205273003: Add onDrawBitmapLattice(), avoid unnecessary bitmap->image copy (Closed) Base URL: https://skia.googlesource.com/skia.git@copypaste
Patch Set: Add support for SkLiteRecorder Created 4 years, 4 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
« src/core/SkLiteDL.cpp ('K') | « src/pdf/SkPDFCanvas.h ('k') | no next file » | 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(image->width(), image->height(), 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
99 void SkPDFCanvas::onDrawBitmapLattice(const SkBitmap& bitmap,
reed1 2016/08/16 11:28:47 General question for PDF canvas (not strictly rela
hal.canary 2016/08/16 14:57:33 No! You need to keep the bitmaps until we get to
100 const Lattice& lattice,
101 const SkRect& dst,
102 const SkPaint* paint) {
103 SkLatticeIter iter(bitmap.width(), bitmap.height(), lattice, dst);
104 SkRect srcR, dstR;
105 while (iter.next(&srcR, &dstR)) {
106 this->drawBitmapRect(bitmap, srcR, dstR, paint);
107 }
108 }
109
OLDNEW
« src/core/SkLiteDL.cpp ('K') | « src/pdf/SkPDFCanvas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698