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

Side by Side Diff: src/core/SkBBoxRecord.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 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkBBoxRecord.h" 9 #include "SkBBoxRecord.h"
10 10
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 const uint16_t indices[], int indexCount, 277 const uint16_t indices[], int indexCount,
278 const SkPaint& paint) { 278 const SkPaint& paint) {
279 SkRect bbox; 279 SkRect bbox;
280 bbox.set(vertices, vertexCount); 280 bbox.set(vertices, vertexCount);
281 if (this->transformBounds(bbox, &paint)) { 281 if (this->transformBounds(bbox, &paint)) {
282 INHERITED::drawVertices(mode, vertexCount, vertices, texs, 282 INHERITED::drawVertices(mode, vertexCount, vertices, texs,
283 colors, xfer, indices, indexCount, paint); 283 colors, xfer, indices, indexCount, paint);
284 } 284 }
285 } 285 }
286 286
287 void SkBBoxRecord::drawPatch(const SkPatch& patch, const SkPaint& paint) { 287 void SkBBoxRecord::drawPatch(const SkPoint cubics[12], const SkColor colors[4],
288 const SkPoint* points = patch.getControlPoints(); 288 const SkPoint texCoords[4], SkXfermode* xmode,
289 const SkPaint& paint) {
290 if (NULL == cubics) {
291 return;
292 }
293
289 SkRect bbox; 294 SkRect bbox;
290 bbox.set(points, SkPatch::kNumCtrlPts); 295 bbox.set(cubics, SkPatch::kNumCtrlPts);
291 if (this->transformBounds(bbox, &paint)) { 296 if (this->transformBounds(bbox, &paint)) {
292 INHERITED::drawPatch(patch, paint); 297 INHERITED::drawPatch(cubics, colors, texCoords, xmode, paint);
293 } 298 }
294 } 299 }
295 300
296 void SkBBoxRecord::onDrawPicture(const SkPicture* picture, const SkMatrix* matri x, 301 void SkBBoxRecord::onDrawPicture(const SkPicture* picture, const SkMatrix* matri x,
297 const SkPaint* paint) { 302 const SkPaint* paint) {
298 SkRect bounds = SkRect::MakeWH(SkIntToScalar(picture->width()), 303 SkRect bounds = SkRect::MakeWH(SkIntToScalar(picture->width()),
299 SkIntToScalar(picture->height())); 304 SkIntToScalar(picture->height()));
300 // todo: wonder if we should allow passing an optional matrix to transformBo unds so we don't 305 // todo: wonder if we should allow passing an optional matrix to transformBo unds so we don't
301 // end up transforming the rect twice. 306 // end up transforming the rect twice.
302 if (matrix) { 307 if (matrix) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 } 359 }
355 360
356 if (!outBounds.isEmpty() && !this->quickReject(outBounds)) { 361 if (!outBounds.isEmpty() && !this->quickReject(outBounds)) {
357 this->getTotalMatrix().mapRect(&outBounds); 362 this->getTotalMatrix().mapRect(&outBounds);
358 this->handleBBox(outBounds); 363 this->handleBBox(outBounds);
359 return true; 364 return true;
360 } 365 }
361 366
362 return false; 367 return false;
363 } 368 }
OLDNEW
« include/core/SkCanvas.h ('K') | « src/core/SkBBoxRecord.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698