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

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: 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') | cc/output/gl_renderer.cc » ('J')
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 // TODO(danakj): The HUD could swap between two textures instead of creating a 91 // TODO(danakj): The HUD could swap between two textures instead of creating a
92 // texture every frame in ubercompositor. 92 // texture every frame in ubercompositor.
93 if (hud_resource_->size() != content_bounds() || 93 if (hud_resource_->size() != content_bounds() ||
94 (hud_resource_->id() && 94 (hud_resource_->id() &&
95 resource_provider->InUseByConsumer(hud_resource_->id()))) { 95 resource_provider->InUseByConsumer(hud_resource_->id()))) {
96 hud_resource_->Free(); 96 hud_resource_->Free();
97 } 97 }
98 98
99 if (!hud_resource_->id()) { 99 if (!hud_resource_->id()) {
100 hud_resource_->Allocate(content_bounds(), 100 hud_resource_->Allocate(
101 ResourceProvider::TextureUsageAny, 101 content_bounds(), ResourceProvider::TextureHintImmutable, RGBA_8888);
102 RGBA_8888);
103 } 102 }
104 103
105 return LayerImpl::WillDraw(draw_mode, resource_provider); 104 return LayerImpl::WillDraw(draw_mode, resource_provider);
106 } 105 }
107 106
108 void HeadsUpDisplayLayerImpl::AppendQuads( 107 void HeadsUpDisplayLayerImpl::AppendQuads(
109 RenderPass* render_pass, 108 RenderPass* render_pass,
110 const OcclusionTracker<LayerImpl>& occlusion_tracker, 109 const OcclusionTracker<LayerImpl>& occlusion_tracker,
111 AppendQuadsData* append_quads_data) { 110 AppendQuadsData* append_quads_data) {
112 if (!hud_resource_->id()) 111 if (!hud_resource_->id())
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 return "cc::HeadsUpDisplayLayerImpl"; 761 return "cc::HeadsUpDisplayLayerImpl";
763 } 762 }
764 763
765 void HeadsUpDisplayLayerImpl::AsValueInto( 764 void HeadsUpDisplayLayerImpl::AsValueInto(
766 base::debug::TracedValue* dict) const { 765 base::debug::TracedValue* dict) const {
767 LayerImpl::AsValueInto(dict); 766 LayerImpl::AsValueInto(dict);
768 dict->SetString("layer_name", "Heads Up Display Layer"); 767 dict->SetString("layer_name", "Heads Up Display Layer");
769 } 768 }
770 769
771 } // namespace cc 770 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/texture_layer_impl.cc » ('j') | cc/output/gl_renderer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698