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

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

Issue 132683003: cc: Rename LayerImpl::DidLoseOutputSurface to ReleaseResources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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
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/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 173
174 gfx::Rect content_rect(content_bounds()); 174 gfx::Rect content_rect(content_bounds());
175 DCHECK(bitmap->config() == SkBitmap::kARGB_8888_Config); 175 DCHECK(bitmap->config() == SkBitmap::kARGB_8888_Config);
176 resource_provider->SetPixels(hud_resource_->id(), 176 resource_provider->SetPixels(hud_resource_->id(),
177 static_cast<const uint8_t*>(bitmap->getPixels()), 177 static_cast<const uint8_t*>(bitmap->getPixels()),
178 content_rect, 178 content_rect,
179 content_rect, 179 content_rect,
180 gfx::Vector2d()); 180 gfx::Vector2d());
181 } 181 }
182 182
183 void HeadsUpDisplayLayerImpl::DidLoseOutputSurface() { hud_resource_.reset(); } 183 void HeadsUpDisplayLayerImpl::ReleaseResources() { hud_resource_.reset(); }
184 184
185 bool HeadsUpDisplayLayerImpl::LayerIsAlwaysDamaged() const { return true; } 185 bool HeadsUpDisplayLayerImpl::LayerIsAlwaysDamaged() const { return true; }
186 186
187 void HeadsUpDisplayLayerImpl::UpdateHudContents() { 187 void HeadsUpDisplayLayerImpl::UpdateHudContents() {
188 const LayerTreeDebugState& debug_state = layer_tree_impl()->debug_state(); 188 const LayerTreeDebugState& debug_state = layer_tree_impl()->debug_state();
189 189
190 // Don't update numbers every frame so text is readable. 190 // Don't update numbers every frame so text is readable.
191 base::TimeTicks now = layer_tree_impl()->CurrentFrameTimeTicks(); 191 base::TimeTicks now = layer_tree_impl()->CurrentFrameTimeTicks();
192 if (base::TimeDelta(now - time_of_last_graph_update_).InSecondsF() > 0.25f) { 192 if (base::TimeDelta(now - time_of_last_graph_update_).InSecondsF() > 0.25f) {
193 time_of_last_graph_update_ = now; 193 time_of_last_graph_update_ = now;
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 canvas->restore(); 703 canvas->restore();
704 } 704 }
705 } 705 }
706 } 706 }
707 707
708 const char* HeadsUpDisplayLayerImpl::LayerTypeAsString() const { 708 const char* HeadsUpDisplayLayerImpl::LayerTypeAsString() const {
709 return "cc::HeadsUpDisplayLayerImpl"; 709 return "cc::HeadsUpDisplayLayerImpl";
710 } 710 }
711 711
712 } // namespace cc 712 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/heads_up_display_layer_impl.h ('k') | cc/layers/heads_up_display_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698