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

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

Issue 463493002: SkCanvas::drawPatch param SkPoint[12] (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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
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 "SkDevice.h" 8 #include "SkDevice.h"
9 #include "SkDraw.h" 9 #include "SkDraw.h"
10 #include "SkMetaData.h" 10 #include "SkMetaData.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 SkPath path; 72 SkPath path;
73 path.addRRect(outer); 73 path.addRRect(outer);
74 path.addRRect(inner); 74 path.addRRect(inner);
75 path.setFillType(SkPath::kEvenOdd_FillType); 75 path.setFillType(SkPath::kEvenOdd_FillType);
76 76
77 const SkMatrix* preMatrix = NULL; 77 const SkMatrix* preMatrix = NULL;
78 const bool pathIsMutable = true; 78 const bool pathIsMutable = true;
79 this->drawPath(draw, path, paint, preMatrix, pathIsMutable); 79 this->drawPath(draw, path, paint, preMatrix, pathIsMutable);
80 } 80 }
81 81
82 void SkBaseDevice::drawPatch(const SkDraw& draw, const SkPatch& patch, const SkP aint& paint) { 82 void SkBaseDevice::drawPatch(const SkDraw& draw, const SkPoint cubics[12], const SkColor colors[4],
83 const SkPoint texCoords[4], SkXfermode* xmode, cons t SkPaint& paint) {
83 SkPatch::VertexData data; 84 SkPatch::VertexData data;
84 85
85 SkISize lod = SkPatchUtils::GetLevelOfDetail(patch, draw.fMatrix); 86 SkISize lod = SkPatchUtils::GetLevelOfDetail(cubics, draw.fMatrix);
86 87
87 // It automatically adjusts lodX and lodY in case it exceeds the number of i ndices. 88 // It automatically adjusts lodX and lodY in case it exceeds the number of i ndices.
88 patch.getVertexData(&data, lod.width(), lod.height()); 89 SkPatchUtils::getVertexData(&data, cubics, colors, texCoords, lod.width(), l od.height());
89 this->drawVertices(draw, SkCanvas::kTriangles_VertexMode, data.fVertexCount, data.fPoints, 90 this->drawVertices(draw, SkCanvas::kTriangles_VertexMode, data.fVertexCount, data.fPoints,
90 data.fTexCoords, data.fColors, NULL, data.fIndices, data. fIndexCount, paint); 91 data.fTexCoords, data.fColors, xmode, data.fIndices, data .fIndexCount, paint);
91 } 92 }
92 93
93 bool SkBaseDevice::readPixels(const SkImageInfo& info, void* dstP, size_t rowByt es, int x, int y) { 94 bool SkBaseDevice::readPixels(const SkImageInfo& info, void* dstP, size_t rowByt es, int x, int y) {
94 #ifdef SK_DEBUG 95 #ifdef SK_DEBUG
95 SkASSERT(info.width() > 0 && info.height() > 0); 96 SkASSERT(info.width() > 0 && info.height() > 0);
96 SkASSERT(dstP); 97 SkASSERT(dstP);
97 SkASSERT(rowBytes >= info.minRowBytes()); 98 SkASSERT(rowBytes >= info.minRowBytes());
98 SkASSERT(x >= 0 && y >= 0); 99 SkASSERT(x >= 0 && y >= 0);
99 100
100 const SkImageInfo& srcInfo = this->imageInfo(); 101 const SkImageInfo& srcInfo = this->imageInfo();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 146
146 void SkBaseDevice::EXPERIMENTAL_optimize(const SkPicture* picture) { 147 void SkBaseDevice::EXPERIMENTAL_optimize(const SkPicture* picture) {
147 // The base class doesn't perform any analysis but derived classes may 148 // The base class doesn't perform any analysis but derived classes may
148 } 149 }
149 150
150 bool SkBaseDevice::EXPERIMENTAL_drawPicture(SkCanvas*, const SkPicture*, const S kMatrix*, 151 bool SkBaseDevice::EXPERIMENTAL_drawPicture(SkCanvas*, const SkPicture*, const S kMatrix*,
151 const SkPaint*) { 152 const SkPaint*) {
152 // The base class doesn't perform any accelerated picture rendering 153 // The base class doesn't perform any accelerated picture rendering
153 return false; 154 return false;
154 } 155 }
OLDNEW
« include/core/SkCanvas.h ('K') | « src/core/SkCanvas.cpp ('k') | src/core/SkPatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698