Chromium Code Reviews| OLD | NEW |
|---|---|
| 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.h" | 5 #include "cc/heads_up_display_layer.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "cc/heads_up_display_layer_impl.h" | 8 #include "cc/heads_up_display_layer_impl.h" |
| 9 #include "cc/layer_tree_host.h" | 9 #include "cc/layer_tree_host.h" |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 void HeadsUpDisplayLayer::update(ResourceUpdateQueue&, const OcclusionTracker*, RenderingStats*) | 28 void HeadsUpDisplayLayer::update(ResourceUpdateQueue&, const OcclusionTracker*, RenderingStats*) |
| 29 { | 29 { |
| 30 const LayerTreeDebugState& debugState = layerTreeHost()->debugState(); | 30 const LayerTreeDebugState& debugState = layerTreeHost()->debugState(); |
| 31 int maxTextureSize = layerTreeHost()->rendererCapabilities().maxTextureSize; | 31 int maxTextureSize = layerTreeHost()->rendererCapabilities().maxTextureSize; |
| 32 | 32 |
| 33 gfx::Size bounds; | 33 gfx::Size bounds; |
| 34 gfx::Transform matrix; | 34 gfx::Transform matrix; |
| 35 matrix.MakeIdentity(); | 35 matrix.MakeIdentity(); |
| 36 | 36 |
| 37 if (debugState.showPlatformLayerTree || debugState.showHudRects()) { | 37 if (debugState.showPlatformLayerTree || debugState.showHudRects()) { |
| 38 int width = std::min(maxTextureSize, layerTreeHost()->layoutViewportSize ().width()); | 38 int width = std::min(maxTextureSize, static_cast<int>(layerTreeHost()->d eviceViewportSize().width() / layerTreeHost()->deviceScaleFactor())); |
|
danakj
2013/02/20 02:46:08
split these "static_cast<>(dVS.width/lTH.dSF)" par
| |
| 39 int height = std::min(maxTextureSize, layerTreeHost()->layoutViewportSiz e().height()); | 39 int height = std::min(maxTextureSize, static_cast<int>(layerTreeHost()-> deviceViewportSize().height() / layerTreeHost()->deviceScaleFactor())); |
| 40 bounds = gfx::Size(width, height); | 40 bounds = gfx::Size(width, height); |
| 41 } else { | 41 } else { |
| 42 bounds = gfx::Size(256, 256); | 42 bounds = gfx::Size(256, 256); |
| 43 matrix.Translate(layerTreeHost()->layoutViewportSize().width() - 256, 0) ; | 43 matrix.Translate(static_cast<int>(layerTreeHost()->deviceViewportSize(). width() / layerTreeHost()->deviceScaleFactor()) - 256, 0); |
| 44 } | 44 } |
| 45 | 45 |
| 46 setBounds(bounds); | 46 setBounds(bounds); |
| 47 setTransform(matrix); | 47 setTransform(matrix); |
| 48 } | 48 } |
| 49 | 49 |
| 50 bool HeadsUpDisplayLayer::drawsContent() const | 50 bool HeadsUpDisplayLayer::drawsContent() const |
| 51 { | 51 { |
| 52 return true; | 52 return true; |
| 53 } | 53 } |
| 54 | 54 |
| 55 scoped_ptr<LayerImpl> HeadsUpDisplayLayer::createLayerImpl(LayerTreeImpl* treeIm pl) | 55 scoped_ptr<LayerImpl> HeadsUpDisplayLayer::createLayerImpl(LayerTreeImpl* treeIm pl) |
| 56 { | 56 { |
| 57 return HeadsUpDisplayLayerImpl::create(treeImpl, m_layerId).PassAs<LayerImpl >(); | 57 return HeadsUpDisplayLayerImpl::create(treeImpl, m_layerId).PassAs<LayerImpl >(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 } // namespace cc | 60 } // namespace cc |
| OLD | NEW |