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/rendering_stats_subscriber.h" |
7 #include "cc/layer_tree_host.h" | 8 #include "cc/layer_tree_host.h" |
8 | 9 |
9 #include "Region.h" | 10 #include "Region.h" |
10 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
11 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
12 #include "cc/font_atlas.h" | 13 #include "cc/font_atlas.h" |
13 #include "cc/graphics_context.h" | 14 #include "cc/graphics_context.h" |
14 #include "cc/heads_up_display_layer.h" | 15 #include "cc/heads_up_display_layer.h" |
15 #include "cc/heads_up_display_layer_impl.h" | 16 #include "cc/heads_up_display_layer_impl.h" |
16 #include "cc/layer.h" | 17 #include "cc/layer.h" |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 | 754 |
754 void LayerTreeHost::stopRateLimiter(WebKit::WebGraphicsContext3D* context) | 755 void LayerTreeHost::stopRateLimiter(WebKit::WebGraphicsContext3D* context) |
755 { | 756 { |
756 RateLimiterMap::iterator it = m_rateLimiters.find(context); | 757 RateLimiterMap::iterator it = m_rateLimiters.find(context); |
757 if (it != m_rateLimiters.end()) { | 758 if (it != m_rateLimiters.end()) { |
758 it->second->stop(); | 759 it->second->stop(); |
759 m_rateLimiters.erase(it); | 760 m_rateLimiters.erase(it); |
760 } | 761 } |
761 } | 762 } |
762 | 763 |
| 764 void LayerTreeHost::startRecordingRenderingStats() |
| 765 { |
| 766 m_renderingStatsSubscriber = RenderingStatsSubscriber::create(); |
| 767 m_proxy->startRecordingRenderingStats(); |
| 768 } |
| 769 |
| 770 void LayerTreeHost::stopRecordingRenderingStats(RenderingStats* stats) |
| 771 { |
| 772 // TODO(vollick): populate the stats here. |
| 773 m_renderingStatsSubscriber.reset(); |
| 774 m_proxy->stopRecordingRenderingStats(stats); |
| 775 } |
| 776 |
763 void LayerTreeHost::rateLimit() | 777 void LayerTreeHost::rateLimit() |
764 { | 778 { |
765 // Force a no-op command on the compositor context, so that any ratelimiting
commands will wait for the compositing | 779 // Force a no-op command on the compositor context, so that any ratelimiting
commands will wait for the compositing |
766 // context, and therefore for the SwapBuffers. | 780 // context, and therefore for the SwapBuffers. |
767 m_proxy->forceSerializeOnSwapBuffers(); | 781 m_proxy->forceSerializeOnSwapBuffers(); |
768 } | 782 } |
769 | 783 |
770 bool LayerTreeHost::bufferedUpdates() | 784 bool LayerTreeHost::bufferedUpdates() |
771 { | 785 { |
772 return m_settings.maxPartialTextureUpdates != numeric_limits<size_t>::max(); | 786 return m_settings.maxPartialTextureUpdates != numeric_limits<size_t>::max(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 else | 847 else |
834 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); | 848 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); |
835 } | 849 } |
836 } | 850 } |
837 | 851 |
838 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) | 852 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) |
839 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); | 853 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); |
840 } | 854 } |
841 | 855 |
842 } // namespace cc | 856 } // namespace cc |
OLD | NEW |