OLD | NEW |
---|---|
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 Loading... | |
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) { | |
288 const SkPoint* points = patch.getControlPoints(); | |
289 SkRect bbox; | |
robertphillips
2014/08/04 18:44:18
12 -> SkPatch::kNumControlPts ?
dandov
2014/08/04 19:59:27
Done. Use constant SkPatch::kNumCtrlPts.
| |
290 bbox.set(points, 12); | |
291 if (this->transformBounds(bbox, &paint)) { | |
292 INHERITED::drawPatch(patch, paint); | |
293 } | |
294 } | |
295 | |
287 void SkBBoxRecord::onDrawPicture(const SkPicture* picture) { | 296 void SkBBoxRecord::onDrawPicture(const SkPicture* picture) { |
288 if (picture->width() > 0 && picture->height() > 0 && | 297 if (picture->width() > 0 && picture->height() > 0 && |
289 this->transformBounds(SkRect::MakeWH(picture->width(), picture->height() ), NULL)) { | 298 this->transformBounds(SkRect::MakeWH(picture->width(), picture->height() ), NULL)) { |
290 this->INHERITED::onDrawPicture(picture); | 299 this->INHERITED::onDrawPicture(picture); |
291 } | 300 } |
292 } | 301 } |
293 | 302 |
294 void SkBBoxRecord::willSave() { | 303 void SkBBoxRecord::willSave() { |
295 fSaveStack.push(NULL); | 304 fSaveStack.push(NULL); |
296 this->INHERITED::willSave(); | 305 this->INHERITED::willSave(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
338 } | 347 } |
339 | 348 |
340 if (!outBounds.isEmpty() && !this->quickReject(outBounds)) { | 349 if (!outBounds.isEmpty() && !this->quickReject(outBounds)) { |
341 this->getTotalMatrix().mapRect(&outBounds); | 350 this->getTotalMatrix().mapRect(&outBounds); |
342 this->handleBBox(outBounds); | 351 this->handleBBox(outBounds); |
343 return true; | 352 return true; |
344 } | 353 } |
345 | 354 |
346 return false; | 355 return false; |
347 } | 356 } |
OLD | NEW |