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

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: numRectsToDraw() 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
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;
110 lattice.fFlagCount = r.flagCount;
109 fCanvas->drawImageLattice(r.image.get(), lattice, r.dst, r.paint); 111 fCanvas->drawImageLattice(r.image.get(), lattice, r.dst, r.paint);
110 } 112 }
111 113
112 DRAW(DrawImageRect, legacy_drawImageRect(r.image.get(), r.src, r.dst, r.paint, r .constraint)); 114 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)); 115 DRAW(DrawImageNine, drawImageNine(r.image.get(), r.center, r.dst, r.paint));
114 DRAW(DrawOval, drawOval(r.oval, r.paint)); 116 DRAW(DrawOval, drawOval(r.oval, r.paint));
115 DRAW(DrawPaint, drawPaint(r.paint)); 117 DRAW(DrawPaint, drawPaint(r.paint));
116 DRAW(DrawPath, drawPath(r.path, r.paint)); 118 DRAW(DrawPath, drawPath(r.path, r.paint));
117 DRAW(DrawPatch, drawPatch(r.cubics, r.colors, r.texCoords, r.xmode, r.paint)); 119 DRAW(DrawPatch, drawPatch(r.cubics, r.colors, r.texCoords, r.xmode, r.paint));
118 DRAW(DrawPicture, drawPicture(r.picture.get(), &r.matrix, r.paint)); 120 DRAW(DrawPicture, drawPicture(r.picture.get(), &r.matrix, r.paint));
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 631
630 void SkRecordFillBounds(const SkRect& cullRect, const SkRecord& record, SkRect b ounds[]) { 632 void SkRecordFillBounds(const SkRect& cullRect, const SkRecord& record, SkRect b ounds[]) {
631 SkRecords::FillBounds visitor(cullRect, record, bounds); 633 SkRecords::FillBounds visitor(cullRect, record, bounds);
632 for (int curOp = 0; curOp < record.count(); curOp++) { 634 for (int curOp = 0; curOp < record.count(); curOp++) {
633 visitor.setCurrentOp(curOp); 635 visitor.setCurrentOp(curOp);
634 record.visit(curOp, visitor); 636 record.visit(curOp, visitor);
635 } 637 }
636 visitor.cleanUp(); 638 visitor.cleanUp();
637 } 639 }
638 640
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698