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

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

Issue 2876033005: Track slow paths in DisplayItemList (Closed)
Patch Set: Created 3 years, 7 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
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 "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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 } 446 }
447 447
448 void PaintOp::RasterWithAlpha(SkCanvas* canvas, uint8_t alpha) const { 448 void PaintOp::RasterWithAlpha(SkCanvas* canvas, uint8_t alpha) const {
449 g_raster_alpha_functions[type](this, canvas, alpha); 449 g_raster_alpha_functions[type](this, canvas, alpha);
450 } 450 }
451 451
452 int ClipPathOp::CountSlowPaths() const { 452 int ClipPathOp::CountSlowPaths() const {
453 return antialias && !path.isConvex() ? 1 : 0; 453 return antialias && !path.isConvex() ? 1 : 0;
454 } 454 }
455 455
456 int DrawDisplayItemListOp::CountSlowPaths() const {
457 return list->NumSlowPaths();
458 }
459
456 int DrawLineOp::CountSlowPaths() const { 460 int DrawLineOp::CountSlowPaths() const {
457 if (const SkPathEffect* effect = flags.getPathEffect()) { 461 if (const SkPathEffect* effect = flags.getPathEffect()) {
458 SkPathEffect::DashInfo info; 462 SkPathEffect::DashInfo info;
459 SkPathEffect::DashType dashType = effect->asADash(&info); 463 SkPathEffect::DashType dashType = effect->asADash(&info);
460 if (flags.getStrokeCap() != PaintFlags::kRound_Cap && 464 if (flags.getStrokeCap() != PaintFlags::kRound_Cap &&
461 dashType == SkPathEffect::kDash_DashType && info.fCount == 2) { 465 dashType == SkPathEffect::kDash_DashType && info.fCount == 2) {
462 // The PaintFlags will count this as 1, so uncount that here as 466 // The PaintFlags will count this as 1, so uncount that here as
463 // this kind of line is special cased and not slow. 467 // this kind of line is special cased and not slow.
464 return -1; 468 return -1;
465 } 469 }
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 return std::make_pair(op, skip); 714 return std::make_pair(op, skip);
711 } 715 }
712 716
713 void PaintOpBuffer::ShrinkToFit() { 717 void PaintOpBuffer::ShrinkToFit() {
714 if (!used_ || used_ == reserved_) 718 if (!used_ || used_ == reserved_)
715 return; 719 return;
716 ReallocBuffer(used_); 720 ReallocBuffer(used_);
717 } 721 }
718 722
719 } // namespace cc 723 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698