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

Side by Side Diff: cc/layers/heads_up_display_layer_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 | « no previous file | cc/layers/texture_layer_impl.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/layers/heads_up_display_layer_impl.h" 5 #include "cc/layers/heads_up_display_layer_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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 ResourceProvider* resource_provider) { 89 ResourceProvider* resource_provider) {
90 for (auto& resource : resources_) { 90 for (auto& resource : resources_) {
91 if (!resource_provider->InUseByConsumer(resource->id())) { 91 if (!resource_provider->InUseByConsumer(resource->id())) {
92 resource.swap(resources_.back()); 92 resource.swap(resources_.back());
93 return; 93 return;
94 } 94 }
95 } 95 }
96 96
97 std::unique_ptr<ScopedResource> resource = 97 std::unique_ptr<ScopedResource> resource =
98 ScopedResource::Create(resource_provider); 98 ScopedResource::Create(resource_provider);
99 resource->Allocate(internal_content_bounds_, 99 resource->Allocate(
100 ResourceProvider::TEXTURE_HINT_IMMUTABLE, 100 internal_content_bounds_, ResourceProvider::TEXTURE_HINT_IMMUTABLE,
101 resource_provider->best_texture_format()); 101 resource_provider->best_texture_format(), gfx::ColorSpace());
102 resources_.push_back(std::move(resource)); 102 resources_.push_back(std::move(resource));
103 } 103 }
104 104
105 void HeadsUpDisplayLayerImpl::ReleaseUnmatchedSizeResources( 105 void HeadsUpDisplayLayerImpl::ReleaseUnmatchedSizeResources(
106 ResourceProvider* resource_provider) { 106 ResourceProvider* resource_provider) {
107 auto it_erase = 107 auto it_erase =
108 std::remove_if(resources_.begin(), resources_.end(), 108 std::remove_if(resources_.begin(), resources_.end(),
109 [this](const std::unique_ptr<ScopedResource>& resource) { 109 [this](const std::unique_ptr<ScopedResource>& resource) {
110 return internal_content_bounds_ != resource->size(); 110 return internal_content_bounds_ != resource->size();
111 }); 111 });
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 return "cc::HeadsUpDisplayLayerImpl"; 798 return "cc::HeadsUpDisplayLayerImpl";
799 } 799 }
800 800
801 void HeadsUpDisplayLayerImpl::AsValueInto( 801 void HeadsUpDisplayLayerImpl::AsValueInto(
802 base::trace_event::TracedValue* dict) const { 802 base::trace_event::TracedValue* dict) const {
803 LayerImpl::AsValueInto(dict); 803 LayerImpl::AsValueInto(dict);
804 dict->SetString("layer_name", "Heads Up Display Layer"); 804 dict->SetString("layer_name", "Heads Up Display Layer");
805 } 805 }
806 806
807 } // namespace cc 807 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/texture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698