OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/paint/paint_op_buffer.h" | 5 #include "cc/paint/paint_op_buffer.h" |
6 | 6 |
7 #include "cc/paint/display_item_list.h" | 7 #include "cc/paint/display_item_list.h" |
8 #include "cc/paint/paint_record.h" | 8 #include "cc/paint/paint_record.h" |
9 #include "third_party/skia/include/core/SkAnnotation.h" | 9 #include "third_party/skia/include/core/SkAnnotation.h" |
10 | 10 |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 } else if (paintStyle == PaintFlags::kFill_Style && | 481 } else if (paintStyle == PaintFlags::kFill_Style && |
482 pathBounds.width() < 64.f && pathBounds.height() < 64.f && | 482 pathBounds.width() < 64.f && pathBounds.height() < 64.f && |
483 !path.isVolatile()) { | 483 !path.isVolatile()) { |
484 // AADF eligible concave path is not slow. | 484 // AADF eligible concave path is not slow. |
485 return 0; | 485 return 0; |
486 } else { | 486 } else { |
487 return 1; | 487 return 1; |
488 } | 488 } |
489 } | 489 } |
490 | 490 |
| 491 int DrawRecordOp::CountSlowPaths() const { |
| 492 return record->numSlowPaths(); |
| 493 } |
| 494 |
491 AnnotateOp::AnnotateOp(PaintCanvas::AnnotationType annotation_type, | 495 AnnotateOp::AnnotateOp(PaintCanvas::AnnotationType annotation_type, |
492 const SkRect& rect, | 496 const SkRect& rect, |
493 sk_sp<SkData> data) | 497 sk_sp<SkData> data) |
494 : annotation_type(annotation_type), rect(rect), data(std::move(data)) {} | 498 : annotation_type(annotation_type), rect(rect), data(std::move(data)) {} |
495 | 499 |
496 AnnotateOp::~AnnotateOp() = default; | 500 AnnotateOp::~AnnotateOp() = default; |
497 | 501 |
498 DrawDisplayItemListOp::DrawDisplayItemListOp( | 502 DrawDisplayItemListOp::DrawDisplayItemListOp( |
499 scoped_refptr<DisplayItemList> list) | 503 scoped_refptr<DisplayItemList> list) |
500 : list(list) {} | 504 : list(list) {} |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 return std::make_pair(op, skip); | 712 return std::make_pair(op, skip); |
709 } | 713 } |
710 | 714 |
711 void PaintOpBuffer::ShrinkToFit() { | 715 void PaintOpBuffer::ShrinkToFit() { |
712 if (!used_ || used_ == reserved_) | 716 if (!used_ || used_ == reserved_) |
713 return; | 717 return; |
714 ReallocBuffer(used_); | 718 ReallocBuffer(used_); |
715 } | 719 } |
716 | 720 |
717 } // namespace cc | 721 } // namespace cc |
OLD | NEW |