OLD | NEW |
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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 dst.set(op.cubics, SkPatchUtils::kNumCtrlPts); | 314 dst.set(op.cubics, SkPatchUtils::kNumCtrlPts); |
315 return this->adjustAndMap(dst, &op.paint); | 315 return this->adjustAndMap(dst, &op.paint); |
316 } | 316 } |
317 Bounds bounds(const DrawVertices& op) const { | 317 Bounds bounds(const DrawVertices& op) const { |
318 SkRect dst; | 318 SkRect dst; |
319 dst.set(op.vertices, op.vertexCount); | 319 dst.set(op.vertices, op.vertexCount); |
320 return this->adjustAndMap(dst, &op.paint); | 320 return this->adjustAndMap(dst, &op.paint); |
321 } | 321 } |
322 | 322 |
323 Bounds bounds(const DrawPicture& op) const { | 323 Bounds bounds(const DrawPicture& op) const { |
324 SkRect dst = SkRect::MakeWH(op.picture->width(), op.picture->height()); | 324 SkRect dst = op.picture->cullRect(); |
325 if (op.matrix) { | 325 if (op.matrix) { |
326 op.matrix->mapRect(&dst); | 326 op.matrix->mapRect(&dst); |
327 } | 327 } |
328 return this->adjustAndMap(dst, op.paint); | 328 return this->adjustAndMap(dst, op.paint); |
329 } | 329 } |
330 | 330 |
331 Bounds bounds(const DrawPosText& op) const { | 331 Bounds bounds(const DrawPosText& op) const { |
332 const int N = op.paint.countText(op.text, op.byteLength); | 332 const int N = op.paint.countText(op.text, op.byteLength); |
333 if (N == 0) { | 333 if (N == 0) { |
334 return Bounds::MakeEmpty(); | 334 return Bounds::MakeEmpty(); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 // Used to track the bounds of Save/Restore blocks and the control ops insid
e them. | 456 // Used to track the bounds of Save/Restore blocks and the control ops insid
e them. |
457 SkTDArray<SaveBounds> fSaveStack; | 457 SkTDArray<SaveBounds> fSaveStack; |
458 SkTDArray<unsigned> fControlIndices; | 458 SkTDArray<unsigned> fControlIndices; |
459 }; | 459 }; |
460 | 460 |
461 } // namespace SkRecords | 461 } // namespace SkRecords |
462 | 462 |
463 void SkRecordFillBounds(const SkRecord& record, SkBBoxHierarchy* bbh) { | 463 void SkRecordFillBounds(const SkRecord& record, SkBBoxHierarchy* bbh) { |
464 SkRecords::FillBounds(record, bbh); | 464 SkRecords::FillBounds(record, bbh); |
465 } | 465 } |
OLD | NEW |