| 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/layer_tree_host.h" | 5 #include "cc/layer_tree_host.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "cc/font_atlas.h" | 9 #include "cc/font_atlas.h" |
| 10 #include "cc/graphics_context.h" | 10 #include "cc/graphics_context.h" |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 if (m_contextLost) { | 493 if (m_contextLost) { |
| 494 if (recreateContext() != RecreateSucceeded) | 494 if (recreateContext() != RecreateSucceeded) |
| 495 return false; | 495 return false; |
| 496 } | 496 } |
| 497 return true; | 497 return true; |
| 498 } | 498 } |
| 499 | 499 |
| 500 void LayerTreeHost::updateLayers(ResourceUpdateQueue& queue, size_t memoryAlloca
tionLimitBytes) | 500 void LayerTreeHost::updateLayers(ResourceUpdateQueue& queue, size_t memoryAlloca
tionLimitBytes) |
| 501 { | 501 { |
| 502 DCHECK(m_rendererInitialized); | 502 DCHECK(m_rendererInitialized); |
| 503 DCHECK(memoryAllocationLimitBytes); | |
| 504 | 503 |
| 505 if (!rootLayer()) | 504 if (!rootLayer()) |
| 506 return; | 505 return; |
| 507 | 506 |
| 508 if (layoutViewportSize().IsEmpty()) | 507 if (layoutViewportSize().IsEmpty()) |
| 509 return; | 508 return; |
| 510 | 509 |
| 511 m_contentsTextureManager->setMaxMemoryLimitBytes(memoryAllocationLimitBytes)
; | 510 if (memoryAllocationLimitBytes) |
| 511 m_contentsTextureManager->setMaxMemoryLimitBytes(memoryAllocationLimitBy
tes); |
| 512 | 512 |
| 513 updateLayers(rootLayer(), queue); | 513 updateLayers(rootLayer(), queue); |
| 514 } | 514 } |
| 515 | 515 |
| 516 static Layer* findFirstScrollableLayer(Layer* layer) | 516 static Layer* findFirstScrollableLayer(Layer* layer) |
| 517 { | 517 { |
| 518 if (!layer) | 518 if (!layer) |
| 519 return 0; | 519 return 0; |
| 520 | 520 |
| 521 if (layer->scrollable()) | 521 if (layer->scrollable()) |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 else | 836 else |
| 837 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); | 837 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); |
| 838 } | 838 } |
| 839 } | 839 } |
| 840 | 840 |
| 841 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) | 841 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) |
| 842 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); | 842 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); |
| 843 } | 843 } |
| 844 | 844 |
| 845 } // namespace cc | 845 } // namespace cc |
| OLD | NEW |