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

Side by Side Diff: cc/layers/heads_up_display_layer_impl.cc

Issue 486853002: cc: Use a normal texture for background texture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits in unittests Created 6 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 <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 // TODO(danakj): The HUD could swap between two textures instead of creating a 92 // TODO(danakj): The HUD could swap between two textures instead of creating a
93 // texture every frame in ubercompositor. 93 // texture every frame in ubercompositor.
94 if (hud_resource_->size() != content_bounds() || 94 if (hud_resource_->size() != content_bounds() ||
95 (hud_resource_->id() && 95 (hud_resource_->id() &&
96 resource_provider->InUseByConsumer(hud_resource_->id()))) { 96 resource_provider->InUseByConsumer(hud_resource_->id()))) {
97 hud_resource_->Free(); 97 hud_resource_->Free();
98 } 98 }
99 99
100 if (!hud_resource_->id()) { 100 if (!hud_resource_->id()) {
101 hud_resource_->Allocate(content_bounds(), 101 hud_resource_->Allocate(
102 ResourceProvider::TextureUsageAny, 102 content_bounds(), ResourceProvider::TextureHintImmutable, RGBA_8888);
103 RGBA_8888);
104 } 103 }
105 104
106 return LayerImpl::WillDraw(draw_mode, resource_provider); 105 return LayerImpl::WillDraw(draw_mode, resource_provider);
107 } 106 }
108 107
109 void HeadsUpDisplayLayerImpl::AppendQuads( 108 void HeadsUpDisplayLayerImpl::AppendQuads(
110 RenderPass* render_pass, 109 RenderPass* render_pass,
111 const OcclusionTracker<LayerImpl>& occlusion_tracker, 110 const OcclusionTracker<LayerImpl>& occlusion_tracker,
112 AppendQuadsData* append_quads_data) { 111 AppendQuadsData* append_quads_data) {
113 if (!hud_resource_->id()) 112 if (!hud_resource_->id())
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 return "cc::HeadsUpDisplayLayerImpl"; 762 return "cc::HeadsUpDisplayLayerImpl";
764 } 763 }
765 764
766 void HeadsUpDisplayLayerImpl::AsValueInto( 765 void HeadsUpDisplayLayerImpl::AsValueInto(
767 base::debug::TracedValue* dict) const { 766 base::debug::TracedValue* dict) const {
768 LayerImpl::AsValueInto(dict); 767 LayerImpl::AsValueInto(dict);
769 dict->SetString("layer_name", "Heads Up Display Layer"); 768 dict->SetString("layer_name", "Heads Up Display Layer");
770 } 769 }
771 770
772 } // namespace cc 771 } // 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