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

Side by Side Diff: cc/resources/managed_tile_state.cc

Issue 412143003: cc: Default initialize solid color in tile version constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/resources/managed_tile_state.h" 5 #include "cc/resources/managed_tile_state.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "cc/base/math_util.h" 9 #include "cc/base/math_util.h"
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 ManagedTileState::ManagedTileState() 47 ManagedTileState::ManagedTileState()
48 : raster_mode(LOW_QUALITY_RASTER_MODE), 48 : raster_mode(LOW_QUALITY_RASTER_MODE),
49 bin(NEVER_BIN), 49 bin(NEVER_BIN),
50 resolution(NON_IDEAL_RESOLUTION), 50 resolution(NON_IDEAL_RESOLUTION),
51 required_for_activation(false), 51 required_for_activation(false),
52 priority_bin(TilePriority::EVENTUALLY), 52 priority_bin(TilePriority::EVENTUALLY),
53 distance_to_visible(std::numeric_limits<float>::infinity()), 53 distance_to_visible(std::numeric_limits<float>::infinity()),
54 visible_and_ready_to_draw(false), 54 visible_and_ready_to_draw(false),
55 scheduled_priority(0) {} 55 scheduled_priority(0) {}
56 56
57 ManagedTileState::TileVersion::TileVersion() : mode_(RESOURCE_MODE) { 57 ManagedTileState::TileVersion::TileVersion()
58 : mode_(RESOURCE_MODE), solid_color_(SK_ColorWHITE) {
58 } 59 }
59 60
60 ManagedTileState::TileVersion::~TileVersion() { DCHECK(!resource_); } 61 ManagedTileState::TileVersion::~TileVersion() { DCHECK(!resource_); }
61 62
62 bool ManagedTileState::TileVersion::IsReadyToDraw() const { 63 bool ManagedTileState::TileVersion::IsReadyToDraw() const {
63 switch (mode_) { 64 switch (mode_) {
64 case RESOURCE_MODE: 65 case RESOURCE_MODE:
65 return !!resource_; 66 return !!resource_;
66 case SOLID_COLOR_MODE: 67 case SOLID_COLOR_MODE:
67 case PICTURE_PILE_MODE: 68 case PICTURE_PILE_MODE:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 tile_versions[raster_mode].mode_ == TileVersion::SOLID_COLOR_MODE); 104 tile_versions[raster_mode].mode_ == TileVersion::SOLID_COLOR_MODE);
104 state->SetBoolean( 105 state->SetBoolean(
105 "is_transparent", 106 "is_transparent",
106 tile_versions[raster_mode].mode_ == TileVersion::SOLID_COLOR_MODE && 107 tile_versions[raster_mode].mode_ == TileVersion::SOLID_COLOR_MODE &&
107 !SkColorGetA(tile_versions[raster_mode].solid_color_)); 108 !SkColorGetA(tile_versions[raster_mode].solid_color_));
108 state->SetInteger("scheduled_priority", scheduled_priority); 109 state->SetInteger("scheduled_priority", scheduled_priority);
109 return state.PassAs<base::Value>(); 110 return state.PassAs<base::Value>();
110 } 111 }
111 112
112 } // namespace cc 113 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698