Chromium Code Reviews| Index: cc/tile_drawing_info.cc |
| diff --git a/cc/tile_drawing_info.cc b/cc/tile_drawing_info.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..381f225775561c1a8aeee763f8a6b18ad8120565 |
| --- /dev/null |
| +++ b/cc/tile_drawing_info.cc |
| @@ -0,0 +1,33 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "cc/tile_drawing_info.h" |
| +#include "cc/tile.h" |
| + |
| +namespace cc { |
| + |
| +bool TileDrawingInfo::is_ready_to_draw() const { |
| + switch(mode_) { |
| + case TEXTURE_MODE: |
| + return tile_->managed_state_.resource && |
|
enne (OOO)
2013/02/27 22:13:57
This conditional should just call GetResourceId().
|
| + !tile_->managed_state_.resource_is_being_initialized && |
| + tile_->managed_state_.resource->id(); |
| + case SOLID_COLOR_MODE: |
| + case TRANSPARENT_MODE: |
| + case PICTURE_PILE_MODE: |
| + return true; |
| + default: |
| + return false; |
|
enne (OOO)
2013/02/27 22:13:57
Maybe also NOTREACHED()?
|
| + } |
| +} |
| + |
| +ResourceProvider::ResourceId TileDrawingInfo::get_resource_id() const { |
| + DCHECK(mode_ == TEXTURE_MODE); |
| + DCHECK(tile_->managed_state_.resource); |
| + DCHECK(!tile_->managed_state_.resource_is_being_initialized); |
| + |
| + return tile_->managed_state_.resource->id(); |
| +} |
| + |
| +} // namespace cc |