| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1134 DCHECK(!output_surface_->capabilities() | 1134 DCHECK(!output_surface_->capabilities() |
| 1135 .draw_and_swap_full_viewport_every_frame); | 1135 .draw_and_swap_full_viewport_every_frame); |
| 1136 return draw_result; | 1136 return draw_result; |
| 1137 } | 1137 } |
| 1138 | 1138 |
| 1139 // If we return DRAW_SUCCESS, then we expect DrawLayers() to be called before | 1139 // If we return DRAW_SUCCESS, then we expect DrawLayers() to be called before |
| 1140 // this function is called again. | 1140 // this function is called again. |
| 1141 return draw_result; | 1141 return draw_result; |
| 1142 } | 1142 } |
| 1143 | 1143 |
| 1144 bool LayerTreeHostImpl::IsTesting() { |
| 1145 return false; |
| 1146 } |
| 1147 |
| 1144 void LayerTreeHostImpl::EvictTexturesForTesting() { | 1148 void LayerTreeHostImpl::EvictTexturesForTesting() { |
| 1145 EnforceManagedMemoryPolicy(ManagedMemoryPolicy(0)); | 1149 EnforceManagedMemoryPolicy(ManagedMemoryPolicy(0)); |
| 1146 } | 1150 } |
| 1147 | 1151 |
| 1148 void LayerTreeHostImpl::BlockNotifyReadyToActivateForTesting(bool block) { | 1152 void LayerTreeHostImpl::BlockNotifyReadyToActivateForTesting(bool block) { |
| 1149 NOTREACHED(); | 1153 NOTREACHED(); |
| 1150 } | 1154 } |
| 1151 | 1155 |
| 1152 void LayerTreeHostImpl::DidInitializeVisibleTileForTesting() { | 1156 void LayerTreeHostImpl::DidInitializeVisibleTileForTesting() { |
| 1153 // Add arbitrary damage, to trigger prepare-to-draws. | 1157 // Add arbitrary damage, to trigger prepare-to-draws. |
| (...skipping 2136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3290 ResourceFormat format = resource_provider_->best_texture_format(); | 3294 ResourceFormat format = resource_provider_->best_texture_format(); |
| 3291 switch (bitmap.GetFormat()) { | 3295 switch (bitmap.GetFormat()) { |
| 3292 case UIResourceBitmap::RGBA8: | 3296 case UIResourceBitmap::RGBA8: |
| 3293 break; | 3297 break; |
| 3294 case UIResourceBitmap::ALPHA_8: | 3298 case UIResourceBitmap::ALPHA_8: |
| 3295 format = ALPHA_8; | 3299 format = ALPHA_8; |
| 3296 break; | 3300 break; |
| 3297 case UIResourceBitmap::ETC1: | 3301 case UIResourceBitmap::ETC1: |
| 3298 format = ETC1; | 3302 format = ETC1; |
| 3299 break; | 3303 break; |
| 3300 }; | 3304 } |
| 3301 id = resource_provider_->CreateResource( | 3305 id = resource_provider_->CreateResource( |
| 3302 bitmap.GetSize(), | 3306 bitmap.GetSize(), |
| 3303 wrap_mode, | 3307 wrap_mode, |
| 3304 ResourceProvider::TextureUsageAny, | 3308 ResourceProvider::TextureUsageAny, |
| 3305 format); | 3309 format); |
| 3306 | 3310 |
| 3307 UIResourceData data; | 3311 UIResourceData data; |
| 3308 data.resource_id = id; | 3312 data.resource_id = id; |
| 3309 data.size = bitmap.GetSize(); | 3313 data.size = bitmap.GetSize(); |
| 3310 data.opaque = bitmap.GetOpaque(); | 3314 data.opaque = bitmap.GetOpaque(); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3406 } | 3410 } |
| 3407 | 3411 |
| 3408 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3412 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3409 std::vector<PictureLayerImpl*>::iterator it = | 3413 std::vector<PictureLayerImpl*>::iterator it = |
| 3410 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3414 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3411 DCHECK(it != picture_layers_.end()); | 3415 DCHECK(it != picture_layers_.end()); |
| 3412 picture_layers_.erase(it); | 3416 picture_layers_.erase(it); |
| 3413 } | 3417 } |
| 3414 | 3418 |
| 3415 } // namespace cc | 3419 } // namespace cc |
| OLD | NEW |