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

Side by Side Diff: cc/paint/paint_op_buffer.cc

Issue 2876033005: Track slow paths in DisplayItemList (Closed)
Patch Set: danakj review Created 3 years, 6 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
« no previous file with comments | « cc/paint/paint_op_buffer.h ('k') | cc/paint/paint_op_buffer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/paint/paint_op_buffer.h ('k') | cc/paint/paint_op_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698