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

Unified Diff: cc/resources/picture_pile_impl.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/picture_pile_impl.h ('k') | cc/resources/picture_pile_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_pile_impl.cc
diff --git a/cc/resources/picture_pile_impl.cc b/cc/resources/picture_pile_impl.cc
index c56a88f802379357ba3694f3fe13349fc8a4b3db..d629888b871e855fb6a98fa4ad7e7a5fb13b586f 100644
--- a/cc/resources/picture_pile_impl.cc
+++ b/cc/resources/picture_pile_impl.cc
@@ -16,16 +16,6 @@
#include "third_party/skia/include/core/SkPictureRecorder.h"
#include "ui/gfx/geometry/rect_conversions.h"
-namespace {
-
-#ifdef NDEBUG
-const bool kDefaultClearCanvasSetting = false;
-#else
-const bool kDefaultClearCanvasSetting = true;
-#endif
-
-} // namespace
-
namespace cc {
scoped_refptr<PicturePileImpl> PicturePileImpl::CreateFromPicturePile(
@@ -40,7 +30,7 @@ PicturePileImpl::PicturePileImpl()
is_solid_color_(false),
solid_color_(SK_ColorTRANSPARENT),
has_any_recordings_(false),
- clear_canvas_with_debug_color_(kDefaultClearCanvasSetting),
+ clear_canvas_with_debug_color_(false),
min_contents_scale_(0.f),
slow_down_raster_scale_factor_for_debug_(0),
should_attempt_to_use_distance_field_text_(false) {
@@ -49,14 +39,14 @@ PicturePileImpl::PicturePileImpl()
PicturePileImpl::PicturePileImpl(const PicturePile* other)
: picture_map_(other->picture_map_),
tiling_(other->tiling_),
- background_color_(SK_ColorTRANSPARENT),
- requires_clear_(true),
+ background_color_(other->background_color_),
+ requires_clear_(other->requires_clear_),
can_use_lcd_text_(other->can_use_lcd_text_),
is_solid_color_(other->is_solid_color_),
solid_color_(other->solid_color_),
recorded_viewport_(other->recorded_viewport_),
has_any_recordings_(other->has_any_recordings_),
- clear_canvas_with_debug_color_(kDefaultClearCanvasSetting),
+ clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_),
min_contents_scale_(other->min_contents_scale_),
slow_down_raster_scale_factor_for_debug_(
other->slow_down_raster_scale_factor_for_debug_),
@@ -88,7 +78,6 @@ void PicturePileImpl::PlaybackToCanvas(SkCanvas* canvas,
RasterSourceHelper::PrepareForPlaybackToCanvas(
canvas, canvas_rect, gfx::Rect(tiling_.tiling_size()), contents_scale,
background_color_, clear_canvas_with_debug_color_, requires_clear_);
-
RasterCommon(canvas,
NULL,
canvas_rect,
@@ -367,19 +356,12 @@ void PicturePileImpl::SetShouldAttemptToUseDistanceFieldText() {
should_attempt_to_use_distance_field_text_ = true;
}
-void PicturePileImpl::SetBackgoundColor(SkColor background_color) {
- background_color_ = background_color;
-}
-
-void PicturePileImpl::SetRequiresClear(bool requires_clear) {
- requires_clear_ = requires_clear;
-}
-
bool PicturePileImpl::ShouldAttemptToUseDistanceFieldText() const {
return should_attempt_to_use_distance_field_text_;
}
-void PicturePileImpl::AsValueInto(base::debug::TracedValue* pictures) const {
+void PicturePileImpl::AsValueInto(
+ base::trace_event::TracedValue* pictures) const {
gfx::Rect tiling_rect(tiling_.tiling_size());
std::set<const void*> appended_pictures;
bool include_borders = true;
@@ -453,10 +435,8 @@ void PicturePileImpl::PixelRefIterator::AdvanceToTilePictureWithPixelRefs() {
void PicturePileImpl::DidBeginTracing() {
std::set<const void*> processed_pictures;
- for (PictureMap::iterator it = picture_map_.begin();
- it != picture_map_.end();
- ++it) {
- const Picture* picture = it->second.GetPicture();
+ for (const auto& map_pair : picture_map_) {
+ const Picture* picture = map_pair.second.GetPicture();
if (picture && (processed_pictures.count(picture) == 0)) {
picture->EmitTraceSnapshot();
processed_pictures.insert(picture);
« no previous file with comments | « cc/resources/picture_pile_impl.h ('k') | cc/resources/picture_pile_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698