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

Side by Side Diff: cc/heads_up_display_layer_impl.cc

Issue 11637032: Revert "cc: Defer texture allocation (to allow async allocations)." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/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 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/heads_up_display_layer_impl.h" 5 #include "cc/heads_up_display_layer_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "cc/debug_colors.h" 10 #include "cc/debug_colors.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 LayerImpl::willDraw(resourceProvider); 69 LayerImpl::willDraw(resourceProvider);
70 70
71 if (!m_hudTexture) 71 if (!m_hudTexture)
72 m_hudTexture = ScopedResource::create(resourceProvider); 72 m_hudTexture = ScopedResource::create(resourceProvider);
73 73
74 // FIXME: Scale the HUD by deviceScale to make it more friendly under high D PI. 74 // FIXME: Scale the HUD by deviceScale to make it more friendly under high D PI.
75 75
76 if (m_hudTexture->size() != bounds()) 76 if (m_hudTexture->size() != bounds())
77 m_hudTexture->Free(); 77 m_hudTexture->Free();
78 78
79 if (!m_hudTexture->id()) { 79 if (!m_hudTexture->id())
80 m_hudTexture->Allocate(bounds(), GL_RGBA, ResourceProvider::TextureUsage Any); 80 m_hudTexture->Allocate(bounds(), GL_RGBA, ResourceProvider::TextureUsage Any);
81 // TODO(epenner): This texture was being used before setPixels was calle d,
82 // which is now not allowed (it's an uninitialized read). This should be fixed
83 // and this allocateForTesting() removed.
84 // http://crbug.com/166784
85 resourceProvider->allocateForTesting(m_hudTexture->id());
86 }
87 } 81 }
88 82
89 void HeadsUpDisplayLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& a ppendQuadsData) 83 void HeadsUpDisplayLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& a ppendQuadsData)
90 { 84 {
91 if (!m_hudTexture->id()) 85 if (!m_hudTexture->id())
92 return; 86 return;
93 87
94 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ uadState()); 88 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ uadState());
95 89
96 gfx::Rect quadRect(gfx::Point(), bounds()); 90 gfx::Rect quadRect(gfx::Point(), bounds());
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 376
383 canvas->restore(); 377 canvas->restore();
384 } 378 }
385 379
386 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const 380 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const
387 { 381 {
388 return "HeadsUpDisplayLayer"; 382 return "HeadsUpDisplayLayer";
389 } 383 }
390 384
391 } // namespace cc 385 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698