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

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

Issue 2305433002: Add option to skip rects to drawImageLattice() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Better detection for zero divs Created 4 years, 3 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/SkPictureRecord.cpp ('k') | src/core/SkRecorder.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 "SkRecordDraw.h" 8 #include "SkRecordDraw.h"
9 #include "SkPatchUtils.h" 9 #include "SkPatchUtils.h"
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 DRAW(DrawArc, drawArc(r.oval, r.startAngle, r.sweepAngle, r.useCenter, r.paint)) ; 99 DRAW(DrawArc, drawArc(r.oval, r.startAngle, r.sweepAngle, r.useCenter, r.paint)) ;
100 DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint)); 100 DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint));
101 DRAW(DrawImage, drawImage(r.image.get(), r.left, r.top, r.paint)); 101 DRAW(DrawImage, drawImage(r.image.get(), r.left, r.top, r.paint));
102 102
103 template <> void Draw::draw(const DrawImageLattice& r) { 103 template <> void Draw::draw(const DrawImageLattice& r) {
104 SkCanvas::Lattice lattice; 104 SkCanvas::Lattice lattice;
105 lattice.fXCount = r.xCount; 105 lattice.fXCount = r.xCount;
106 lattice.fXDivs = r.xDivs; 106 lattice.fXDivs = r.xDivs;
107 lattice.fYCount = r.yCount; 107 lattice.fYCount = r.yCount;
108 lattice.fYDivs = r.yDivs; 108 lattice.fYDivs = r.yDivs;
109 lattice.fFlags = (0 == r.flagCount) ? nullptr : r.flags;
109 fCanvas->drawImageLattice(r.image.get(), lattice, r.dst, r.paint); 110 fCanvas->drawImageLattice(r.image.get(), lattice, r.dst, r.paint);
110 } 111 }
111 112
112 DRAW(DrawImageRect, legacy_drawImageRect(r.image.get(), r.src, r.dst, r.paint, r .constraint)); 113 DRAW(DrawImageRect, legacy_drawImageRect(r.image.get(), r.src, r.dst, r.paint, r .constraint));
113 DRAW(DrawImageNine, drawImageNine(r.image.get(), r.center, r.dst, r.paint)); 114 DRAW(DrawImageNine, drawImageNine(r.image.get(), r.center, r.dst, r.paint));
114 DRAW(DrawOval, drawOval(r.oval, r.paint)); 115 DRAW(DrawOval, drawOval(r.oval, r.paint));
115 DRAW(DrawPaint, drawPaint(r.paint)); 116 DRAW(DrawPaint, drawPaint(r.paint));
116 DRAW(DrawPath, drawPath(r.path, r.paint)); 117 DRAW(DrawPath, drawPath(r.path, r.paint));
117 DRAW(DrawPatch, drawPatch(r.cubics, r.colors, r.texCoords, r.xmode, r.paint)); 118 DRAW(DrawPatch, drawPatch(r.cubics, r.colors, r.texCoords, r.xmode, r.paint));
118 DRAW(DrawPicture, drawPicture(r.picture.get(), &r.matrix, r.paint)); 119 DRAW(DrawPicture, drawPicture(r.picture.get(), &r.matrix, r.paint));
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 630
630 void SkRecordFillBounds(const SkRect& cullRect, const SkRecord& record, SkRect b ounds[]) { 631 void SkRecordFillBounds(const SkRect& cullRect, const SkRecord& record, SkRect b ounds[]) {
631 SkRecords::FillBounds visitor(cullRect, record, bounds); 632 SkRecords::FillBounds visitor(cullRect, record, bounds);
632 for (int curOp = 0; curOp < record.count(); curOp++) { 633 for (int curOp = 0; curOp < record.count(); curOp++) {
633 visitor.setCurrentOp(curOp); 634 visitor.setCurrentOp(curOp);
634 record.visit(curOp, visitor); 635 record.visit(curOp, visitor);
635 } 636 }
636 visitor.cleanUp(); 637 visitor.cleanUp();
637 } 638 }
638 639
OLDNEW
« no previous file with comments | « src/core/SkPictureRecord.cpp ('k') | src/core/SkRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698