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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "cc/layer_tree_host.h" | 7 #include "cc/layer_tree_host.h" |
8 | 8 |
9 #include "Region.h" | 9 #include "Region.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 if (m_contextLost) { | 490 if (m_contextLost) { |
491 if (recreateContext() != RecreateSucceeded) | 491 if (recreateContext() != RecreateSucceeded) |
492 return false; | 492 return false; |
493 } | 493 } |
494 return true; | 494 return true; |
495 } | 495 } |
496 | 496 |
497 void LayerTreeHost::updateLayers(ResourceUpdateQueue& queue, size_t memoryAlloca
tionLimitBytes) | 497 void LayerTreeHost::updateLayers(ResourceUpdateQueue& queue, size_t memoryAlloca
tionLimitBytes) |
498 { | 498 { |
499 DCHECK(m_rendererInitialized); | 499 DCHECK(m_rendererInitialized); |
500 DCHECK(memoryAllocationLimitBytes); | |
501 | 500 |
502 if (!rootLayer()) | 501 if (!rootLayer()) |
503 return; | 502 return; |
504 | 503 |
505 if (layoutViewportSize().isEmpty()) | 504 if (layoutViewportSize().isEmpty()) |
506 return; | 505 return; |
507 | 506 |
508 m_contentsTextureManager->setMaxMemoryLimitBytes(memoryAllocationLimitBytes)
; | 507 if (memoryAllocationLimitBytes) |
| 508 m_contentsTextureManager->setMaxMemoryLimitBytes(memoryAllocationLimitBy
tes); |
509 | 509 |
510 updateLayers(rootLayer(), queue); | 510 updateLayers(rootLayer(), queue); |
511 } | 511 } |
512 | 512 |
513 static Layer* findFirstScrollableLayer(Layer* layer) | 513 static Layer* findFirstScrollableLayer(Layer* layer) |
514 { | 514 { |
515 if (!layer) | 515 if (!layer) |
516 return 0; | 516 return 0; |
517 | 517 |
518 if (layer->scrollable()) | 518 if (layer->scrollable()) |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 else | 812 else |
813 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); | 813 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); |
814 } | 814 } |
815 } | 815 } |
816 | 816 |
817 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) | 817 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) |
818 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); | 818 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); |
819 } | 819 } |
820 | 820 |
821 } // namespace cc | 821 } // namespace cc |
OLD | NEW |