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 3280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3291 switch (bitmap.GetFormat()) { | 3291 switch (bitmap.GetFormat()) { |
3292 case UIResourceBitmap::RGBA8: | 3292 case UIResourceBitmap::RGBA8: |
3293 break; | 3293 break; |
3294 case UIResourceBitmap::ALPHA_8: | 3294 case UIResourceBitmap::ALPHA_8: |
3295 format = ALPHA_8; | 3295 format = ALPHA_8; |
3296 break; | 3296 break; |
3297 case UIResourceBitmap::ETC1: | 3297 case UIResourceBitmap::ETC1: |
3298 format = ETC1; | 3298 format = ETC1; |
3299 break; | 3299 break; |
3300 } | 3300 } |
3301 id = resource_provider_->CreateResource( | 3301 id = |
danakj
2014/08/20 15:58:02
i assume clang-format did this? i will file a bug,
| |
3302 bitmap.GetSize(), | 3302 resource_provider_->CreateResource(bitmap.GetSize(), |
3303 wrap_mode, | 3303 wrap_mode, |
3304 ResourceProvider::TextureUsageAny, | 3304 ResourceProvider::TextureHintImmutable, |
3305 format); | 3305 format); |
3306 | 3306 |
3307 UIResourceData data; | 3307 UIResourceData data; |
3308 data.resource_id = id; | 3308 data.resource_id = id; |
3309 data.size = bitmap.GetSize(); | 3309 data.size = bitmap.GetSize(); |
3310 data.opaque = bitmap.GetOpaque(); | 3310 data.opaque = bitmap.GetOpaque(); |
3311 | 3311 |
3312 ui_resource_map_[uid] = data; | 3312 ui_resource_map_[uid] = data; |
3313 | 3313 |
3314 AutoLockUIResourceBitmap bitmap_lock(bitmap); | 3314 AutoLockUIResourceBitmap bitmap_lock(bitmap); |
3315 resource_provider_->SetPixels(id, | 3315 resource_provider_->SetPixels(id, |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3406 } | 3406 } |
3407 | 3407 |
3408 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3408 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
3409 std::vector<PictureLayerImpl*>::iterator it = | 3409 std::vector<PictureLayerImpl*>::iterator it = |
3410 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3410 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
3411 DCHECK(it != picture_layers_.end()); | 3411 DCHECK(it != picture_layers_.end()); |
3412 picture_layers_.erase(it); | 3412 picture_layers_.erase(it); |
3413 } | 3413 } |
3414 | 3414 |
3415 } // namespace cc | 3415 } // namespace cc |
OLD | NEW |