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

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

Issue 22875045: cc: Remove unnecessary "default" cases from switch statements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix HasFilterThatMovesPixels()/HasFilterThatAffectsOpacity() Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « cc/resources/managed_tile_state.h ('k') | cc/resources/platform_color.h » ('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 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 DCHECK(!resource_); 80 DCHECK(!resource_);
81 } 81 }
82 82
83 bool ManagedTileState::TileVersion::IsReadyToDraw() const { 83 bool ManagedTileState::TileVersion::IsReadyToDraw() const {
84 switch (mode_) { 84 switch (mode_) {
85 case RESOURCE_MODE: 85 case RESOURCE_MODE:
86 return !!resource_; 86 return !!resource_;
87 case SOLID_COLOR_MODE: 87 case SOLID_COLOR_MODE:
88 case PICTURE_PILE_MODE: 88 case PICTURE_PILE_MODE:
89 return true; 89 return true;
90 default:
91 NOTREACHED();
92 return false;
93 } 90 }
91 NOTREACHED();
92 return false;
94 } 93 }
95 94
96 size_t ManagedTileState::TileVersion::GPUMemoryUsageInBytes() const { 95 size_t ManagedTileState::TileVersion::GPUMemoryUsageInBytes() const {
97 if (!resource_) 96 if (!resource_)
98 return 0; 97 return 0;
99 return resource_->bytes(); 98 return resource_->bytes();
100 } 99 }
101 100
102 ManagedTileState::~ManagedTileState() { 101 ManagedTileState::~ManagedTileState() {
103 } 102 }
(...skipping 18 matching lines...) Expand all
122 state->SetBoolean( 121 state->SetBoolean(
123 "is_transparent", 122 "is_transparent",
124 tile_versions[raster_mode].mode_ == TileVersion::SOLID_COLOR_MODE && 123 tile_versions[raster_mode].mode_ == TileVersion::SOLID_COLOR_MODE &&
125 !SkColorGetA(tile_versions[raster_mode].solid_color_)); 124 !SkColorGetA(tile_versions[raster_mode].solid_color_));
126 state->SetInteger("scheduled_priority", scheduled_priority); 125 state->SetInteger("scheduled_priority", scheduled_priority);
127 return state.PassAs<base::Value>(); 126 return state.PassAs<base::Value>();
128 } 127 }
129 128
130 } // namespace cc 129 } // namespace cc
131 130
OLDNEW
« no previous file with comments | « cc/resources/managed_tile_state.h ('k') | cc/resources/platform_color.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698