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

Side by Side Diff: src/core/SkCanvas.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 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
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 8
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCanvasPriv.h" 10 #include "SkCanvasPriv.h"
(...skipping 2236 matching lines...) Expand 10 before | Expand all | Expand 10 after
2247 2247
2248 while (iter.next()) { 2248 while (iter.next()) {
2249 iter.fDevice->drawVertices(iter, vmode, vertexCount, verts, texs, 2249 iter.fDevice->drawVertices(iter, vmode, vertexCount, verts, texs,
2250 colors, xmode, indices, indexCount, 2250 colors, xmode, indices, indexCount,
2251 looper.paint()); 2251 looper.paint());
2252 } 2252 }
2253 2253
2254 LOOPER_END 2254 LOOPER_END
2255 } 2255 }
2256 2256
2257 void SkCanvas::drawPatch(const SkPatch& patch, const SkPaint& paint) { 2257 void SkCanvas::drawPatch(const SkPoint cubics[12], const SkColor colors[4],
2258 const SkPoint texCoords[4], SkXfermode* xmode, const Sk Paint& paint) {
2259 if (NULL == cubics) {
2260 return;
2261 }
2258 2262
2259 // Since a patch is always within the convex hull of the control points, we discard it when its 2263 // Since a patch is always within the convex hull of the control points, we discard it when its
2260 // bounding rectangle is completely outside the current clip. 2264 // bounding rectangle is completely outside the current clip.
2261 SkRect bounds; 2265 SkRect bounds;
2262 bounds.set(patch.getControlPoints(), SkPatch::kNumCtrlPts); 2266 bounds.set(cubics, SkPatch::kNumCtrlPts);
2263 if (this->quickReject(bounds)) { 2267 if (this->quickReject(bounds)) {
2264 return; 2268 return;
2265 } 2269 }
2266 2270
2267 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, NULL) 2271 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, NULL)
2268 2272
2269 while (iter.next()) { 2273 while (iter.next()) {
2270 iter.fDevice->drawPatch(iter, patch, paint); 2274 iter.fDevice->drawPatch(iter, cubics, colors, texCoords, xmode, paint);
2271 } 2275 }
2272 2276
2273 LOOPER_END 2277 LOOPER_END
2274 } 2278 }
2275 2279
2276 ////////////////////////////////////////////////////////////////////////////// 2280 //////////////////////////////////////////////////////////////////////////////
2277 // These methods are NOT virtual, and therefore must call back into virtual 2281 // These methods are NOT virtual, and therefore must call back into virtual
2278 // methods, rather than actually drawing themselves. 2282 // methods, rather than actually drawing themselves.
2279 ////////////////////////////////////////////////////////////////////////////// 2283 //////////////////////////////////////////////////////////////////////////////
2280 2284
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
2541 } 2545 }
2542 2546
2543 if (NULL != matrix) { 2547 if (NULL != matrix) {
2544 canvas->concat(*matrix); 2548 canvas->concat(*matrix);
2545 } 2549 }
2546 } 2550 }
2547 2551
2548 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 2552 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
2549 fCanvas->restoreToCount(fSaveCount); 2553 fCanvas->restoreToCount(fSaveCount);
2550 } 2554 }
OLDNEW
« include/core/SkCanvas.h ('K') | « src/core/SkBBoxRecord.cpp ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698