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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 2235623003: cc: Add gfx::ColorSpace to cc::ResourceProvider resource creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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
« no previous file with comments | « cc/tiles/tile_manager_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('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 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
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
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
OLDNEW
« no previous file with comments | « cc/tiles/tile_manager_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698