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 "base/containers/stack_container.h" | 7 #include "base/containers/stack_container.h" |
8 #include "cc/paint/display_item_list.h" | 8 #include "cc/paint/display_item_list.h" |
9 #include "cc/paint/paint_record.h" | 9 #include "cc/paint/paint_record.h" |
10 #include "third_party/skia/include/core/SkAnnotation.h" | 10 #include "third_party/skia/include/core/SkAnnotation.h" |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 } | 447 } |
448 | 448 |
449 void PaintOp::RasterWithAlpha(SkCanvas* canvas, uint8_t alpha) const { | 449 void PaintOp::RasterWithAlpha(SkCanvas* canvas, uint8_t alpha) const { |
450 g_raster_alpha_functions[type](this, canvas, alpha); | 450 g_raster_alpha_functions[type](this, canvas, alpha); |
451 } | 451 } |
452 | 452 |
453 int ClipPathOp::CountSlowPaths() const { | 453 int ClipPathOp::CountSlowPaths() const { |
454 return antialias && !path.isConvex() ? 1 : 0; | 454 return antialias && !path.isConvex() ? 1 : 0; |
455 } | 455 } |
456 | 456 |
| 457 int DrawDisplayItemListOp::CountSlowPaths() const { |
| 458 return list->NumSlowPaths(); |
| 459 } |
| 460 |
457 int DrawLineOp::CountSlowPaths() const { | 461 int DrawLineOp::CountSlowPaths() const { |
458 if (const SkPathEffect* effect = flags.getPathEffect()) { | 462 if (const SkPathEffect* effect = flags.getPathEffect()) { |
459 SkPathEffect::DashInfo info; | 463 SkPathEffect::DashInfo info; |
460 SkPathEffect::DashType dashType = effect->asADash(&info); | 464 SkPathEffect::DashType dashType = effect->asADash(&info); |
461 if (flags.getStrokeCap() != PaintFlags::kRound_Cap && | 465 if (flags.getStrokeCap() != PaintFlags::kRound_Cap && |
462 dashType == SkPathEffect::kDash_DashType && info.fCount == 2) { | 466 dashType == SkPathEffect::kDash_DashType && info.fCount == 2) { |
463 // The PaintFlags will count this as 1, so uncount that here as | 467 // The PaintFlags will count this as 1, so uncount that here as |
464 // this kind of line is special cased and not slow. | 468 // this kind of line is special cased and not slow. |
465 return -1; | 469 return -1; |
466 } | 470 } |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 return std::make_pair(op, skip); | 792 return std::make_pair(op, skip); |
789 } | 793 } |
790 | 794 |
791 void PaintOpBuffer::ShrinkToFit() { | 795 void PaintOpBuffer::ShrinkToFit() { |
792 if (!used_ || used_ == reserved_) | 796 if (!used_ || used_ == reserved_) |
793 return; | 797 return; |
794 ReallocBuffer(used_); | 798 ReallocBuffer(used_); |
795 } | 799 } |
796 | 800 |
797 } // namespace cc | 801 } // namespace cc |
OLD | NEW |