| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1358 | 1358 |
| 1359 // See note in LayerTreeImpl::UpdateDrawProperties. Renderer needs | 1359 // See note in LayerTreeImpl::UpdateDrawProperties. Renderer needs |
| 1360 // to be initialized to get max texture size. | 1360 // to be initialized to get max texture size. |
| 1361 active_tree_->set_needs_update_draw_properties(); | 1361 active_tree_->set_needs_update_draw_properties(); |
| 1362 if (pending_tree_) | 1362 if (pending_tree_) |
| 1363 pending_tree_->set_needs_update_draw_properties(); | 1363 pending_tree_->set_needs_update_draw_properties(); |
| 1364 | 1364 |
| 1365 return true; | 1365 return true; |
| 1366 } | 1366 } |
| 1367 | 1367 |
| 1368 void LayerTreeHostImpl::SetViewportSize(gfx::Size layout_viewport_size, | 1368 void LayerTreeHostImpl::SetViewportSize(gfx::Size device_viewport_size) { |
| 1369 gfx::Size device_viewport_size) { | 1369 if (device_viewport_size == device_viewport_size_) |
| 1370 if (layout_viewport_size == layout_viewport_size_ && | |
| 1371 device_viewport_size == device_viewport_size_) | |
| 1372 return; | 1370 return; |
| 1373 | 1371 |
| 1374 if (pending_tree_ && device_viewport_size_ != device_viewport_size) | 1372 if (pending_tree_ && device_viewport_size_ != device_viewport_size) |
| 1375 active_tree_->SetViewportSizeInvalid(); | 1373 active_tree_->SetViewportSizeInvalid(); |
| 1376 | 1374 |
| 1377 layout_viewport_size_ = layout_viewport_size; | |
| 1378 device_viewport_size_ = device_viewport_size; | 1375 device_viewport_size_ = device_viewport_size; |
| 1379 | 1376 |
| 1380 UpdateMaxScrollOffset(); | 1377 UpdateMaxScrollOffset(); |
| 1381 | 1378 |
| 1382 if (renderer_) | 1379 if (renderer_) |
| 1383 renderer_->ViewportChanged(); | 1380 renderer_->ViewportChanged(); |
| 1384 | 1381 |
| 1385 client_->OnCanDrawStateChanged(CanDraw()); | 1382 client_->OnCanDrawStateChanged(CanDraw()); |
| 1386 } | 1383 } |
| 1387 | 1384 |
| (...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2087 } | 2084 } |
| 2088 | 2085 |
| 2089 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { | 2086 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { |
| 2090 if (debug_state_.continuous_painting != debug_state.continuous_painting) | 2087 if (debug_state_.continuous_painting != debug_state.continuous_painting) |
| 2091 paint_time_counter_->ClearHistory(); | 2088 paint_time_counter_->ClearHistory(); |
| 2092 | 2089 |
| 2093 debug_state_ = debug_state; | 2090 debug_state_ = debug_state; |
| 2094 } | 2091 } |
| 2095 | 2092 |
| 2096 } // namespace cc | 2093 } // namespace cc |
| OLD | NEW |