| 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 "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 { | 620 { |
| 621 size_t readbackBytes = 0; | 621 size_t readbackBytes = 0; |
| 622 size_t maxBackgroundTextureBytes = 0; | 622 size_t maxBackgroundTextureBytes = 0; |
| 623 size_t contentsTextureBytes = 0; | 623 size_t contentsTextureBytes = 0; |
| 624 | 624 |
| 625 // Start iteration at 1 to skip the root surface as it does not have a textu
re cost. | 625 // Start iteration at 1 to skip the root surface as it does not have a textu
re cost. |
| 626 for (size_t i = 1; i < updateList.size(); ++i) { | 626 for (size_t i = 1; i < updateList.size(); ++i) { |
| 627 Layer* renderSurfaceLayer = updateList[i].get(); | 627 Layer* renderSurfaceLayer = updateList[i].get(); |
| 628 RenderSurface* renderSurface = renderSurfaceLayer->renderSurface(); | 628 RenderSurface* renderSurface = renderSurfaceLayer->renderSurface(); |
| 629 | 629 |
| 630 size_t bytes = Texture::memorySizeBytes(renderSurface->contentRect().siz
e(), GL_RGBA); | 630 size_t bytes = Resource::memorySizeBytes(renderSurface->contentRect().si
ze(), GL_RGBA); |
| 631 contentsTextureBytes += bytes; | 631 contentsTextureBytes += bytes; |
| 632 | 632 |
| 633 if (renderSurfaceLayer->backgroundFilters().isEmpty()) | 633 if (renderSurfaceLayer->backgroundFilters().isEmpty()) |
| 634 continue; | 634 continue; |
| 635 | 635 |
| 636 if (bytes > maxBackgroundTextureBytes) | 636 if (bytes > maxBackgroundTextureBytes) |
| 637 maxBackgroundTextureBytes = bytes; | 637 maxBackgroundTextureBytes = bytes; |
| 638 if (!readbackBytes) | 638 if (!readbackBytes) |
| 639 readbackBytes = Texture::memorySizeBytes(m_deviceViewportSize, GL_RG
BA); | 639 readbackBytes = Resource::memorySizeBytes(m_deviceViewportSize, GL_R
GBA); |
| 640 } | 640 } |
| 641 return readbackBytes + maxBackgroundTextureBytes + contentsTextureBytes; | 641 return readbackBytes + maxBackgroundTextureBytes + contentsTextureBytes; |
| 642 } | 642 } |
| 643 | 643 |
| 644 bool LayerTreeHost::paintMasksForRenderSurface(Layer* renderSurfaceLayer, Resour
ceUpdateQueue& queue) | 644 bool LayerTreeHost::paintMasksForRenderSurface(Layer* renderSurfaceLayer, Resour
ceUpdateQueue& queue) |
| 645 { | 645 { |
| 646 // Note: Masks and replicas only exist for layers that own render surfaces.
If we reach this point | 646 // Note: Masks and replicas only exist for layers that own render surfaces.
If we reach this point |
| 647 // in code, we already know that at least something will be drawn into this
render surface, so the | 647 // in code, we already know that at least something will be drawn into this
render surface, so the |
| 648 // mask and replica should be painted. | 648 // mask and replica should be painted. |
| 649 | 649 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 else | 840 else |
| 841 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); | 841 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); |
| 842 } | 842 } |
| 843 } | 843 } |
| 844 | 844 |
| 845 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) | 845 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) |
| 846 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); | 846 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); |
| 847 } | 847 } |
| 848 | 848 |
| 849 } // namespace cc | 849 } // namespace cc |
| OLD | NEW |