| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "cc/font_atlas.h" | 10 #include "cc/font_atlas.h" |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 { | 635 { |
| 636 size_t readbackBytes = 0; | 636 size_t readbackBytes = 0; |
| 637 size_t maxBackgroundTextureBytes = 0; | 637 size_t maxBackgroundTextureBytes = 0; |
| 638 size_t contentsTextureBytes = 0; | 638 size_t contentsTextureBytes = 0; |
| 639 | 639 |
| 640 // Start iteration at 1 to skip the root surface as it does not have a textu
re cost. | 640 // Start iteration at 1 to skip the root surface as it does not have a textu
re cost. |
| 641 for (size_t i = 1; i < updateList.size(); ++i) { | 641 for (size_t i = 1; i < updateList.size(); ++i) { |
| 642 Layer* renderSurfaceLayer = updateList[i].get(); | 642 Layer* renderSurfaceLayer = updateList[i].get(); |
| 643 RenderSurface* renderSurface = renderSurfaceLayer->renderSurface(); | 643 RenderSurface* renderSurface = renderSurfaceLayer->renderSurface(); |
| 644 | 644 |
| 645 size_t bytes = Resource::memorySizeBytes(renderSurface->contentRect().si
ze(), GL_RGBA); | 645 size_t bytes = Resource::MemorySizeBytes(renderSurface->contentRect().si
ze(), GL_RGBA); |
| 646 contentsTextureBytes += bytes; | 646 contentsTextureBytes += bytes; |
| 647 | 647 |
| 648 if (renderSurfaceLayer->backgroundFilters().isEmpty()) | 648 if (renderSurfaceLayer->backgroundFilters().isEmpty()) |
| 649 continue; | 649 continue; |
| 650 | 650 |
| 651 if (bytes > maxBackgroundTextureBytes) | 651 if (bytes > maxBackgroundTextureBytes) |
| 652 maxBackgroundTextureBytes = bytes; | 652 maxBackgroundTextureBytes = bytes; |
| 653 if (!readbackBytes) | 653 if (!readbackBytes) |
| 654 readbackBytes = Resource::memorySizeBytes(m_deviceViewportSize, GL_R
GBA); | 654 readbackBytes = Resource::MemorySizeBytes(m_deviceViewportSize, GL_R
GBA); |
| 655 } | 655 } |
| 656 return readbackBytes + maxBackgroundTextureBytes + contentsTextureBytes; | 656 return readbackBytes + maxBackgroundTextureBytes + contentsTextureBytes; |
| 657 } | 657 } |
| 658 | 658 |
| 659 bool LayerTreeHost::paintMasksForRenderSurface(Layer* renderSurfaceLayer, Resour
ceUpdateQueue& queue) | 659 bool LayerTreeHost::paintMasksForRenderSurface(Layer* renderSurfaceLayer, Resour
ceUpdateQueue& queue) |
| 660 { | 660 { |
| 661 // Note: Masks and replicas only exist for layers that own render surfaces.
If we reach this point | 661 // Note: Masks and replicas only exist for layers that own render surfaces.
If we reach this point |
| 662 // in code, we already know that at least something will be drawn into this
render surface, so the | 662 // in code, we already know that at least something will be drawn into this
render surface, so the |
| 663 // mask and replica should be painted. | 663 // mask and replica should be painted. |
| 664 | 664 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 else | 855 else |
| 856 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); | 856 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); |
| 857 } | 857 } |
| 858 } | 858 } |
| 859 | 859 |
| 860 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) | 860 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) |
| 861 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); | 861 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); |
| 862 } | 862 } |
| 863 | 863 |
| 864 } // namespace cc | 864 } // namespace cc |
| OLD | NEW |