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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 3646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3657 case UIResourceBitmap::RGBA8: | 3657 case UIResourceBitmap::RGBA8: |
3658 break; | 3658 break; |
3659 case UIResourceBitmap::ALPHA_8: | 3659 case UIResourceBitmap::ALPHA_8: |
3660 format = ALPHA_8; | 3660 format = ALPHA_8; |
3661 break; | 3661 break; |
3662 case UIResourceBitmap::ETC1: | 3662 case UIResourceBitmap::ETC1: |
3663 format = ETC1; | 3663 format = ETC1; |
3664 break; | 3664 break; |
3665 } | 3665 } |
3666 id = resource_provider_->CreateResource( | 3666 id = resource_provider_->CreateResource( |
3667 bitmap.GetSize(), ResourceProvider::TEXTURE_HINT_IMMUTABLE, format); | 3667 bitmap.GetSize(), ResourceProvider::TEXTURE_HINT_IMMUTABLE, format, |
| 3668 gfx::ColorSpace()); |
3668 | 3669 |
3669 UIResourceData data; | 3670 UIResourceData data; |
3670 data.resource_id = id; | 3671 data.resource_id = id; |
3671 data.size = bitmap.GetSize(); | 3672 data.size = bitmap.GetSize(); |
3672 data.opaque = bitmap.GetOpaque(); | 3673 data.opaque = bitmap.GetOpaque(); |
3673 | 3674 |
3674 ui_resource_map_[uid] = data; | 3675 ui_resource_map_[uid] = data; |
3675 | 3676 |
3676 AutoLockUIResourceBitmap bitmap_lock(bitmap); | 3677 AutoLockUIResourceBitmap bitmap_lock(bitmap); |
3677 resource_provider_->CopyToResource(id, bitmap_lock.GetPixels(), | 3678 resource_provider_->CopyToResource(id, bitmap_lock.GetPixels(), |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4012 return task_runner_provider_->HasImplThread(); | 4013 return task_runner_provider_->HasImplThread(); |
4013 } | 4014 } |
4014 | 4015 |
4015 bool LayerTreeHostImpl::CommitToActiveTree() const { | 4016 bool LayerTreeHostImpl::CommitToActiveTree() const { |
4016 // In single threaded mode we skip the pending tree and commit directly to the | 4017 // In single threaded mode we skip the pending tree and commit directly to the |
4017 // active tree. | 4018 // active tree. |
4018 return !task_runner_provider_->HasImplThread(); | 4019 return !task_runner_provider_->HasImplThread(); |
4019 } | 4020 } |
4020 | 4021 |
4021 } // namespace cc | 4022 } // namespace cc |
OLD | NEW |