Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: cc/layer_tree_host_impl.cc

Issue 11316128: Send compositor frame IPC with metadata. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« cc/compositor_frame_metadata.h ('K') | « cc/layer_tree_host_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_impl.h" 5 #include "cc/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
11 #include "cc/append_quads_data.h" 11 #include "cc/append_quads_data.h"
12 #include "cc/compositor_frame_metadata.h"
12 #include "cc/damage_tracker.h" 13 #include "cc/damage_tracker.h"
13 #include "cc/debug_rect_history.h" 14 #include "cc/debug_rect_history.h"
14 #include "cc/delay_based_time_source.h" 15 #include "cc/delay_based_time_source.h"
15 #include "cc/font_atlas.h" 16 #include "cc/font_atlas.h"
16 #include "cc/frame_rate_counter.h" 17 #include "cc/frame_rate_counter.h"
17 #include "cc/gl_renderer.h" 18 #include "cc/gl_renderer.h"
18 #include "cc/heads_up_display_layer_impl.h" 19 #include "cc/heads_up_display_layer_impl.h"
19 #include "cc/layer_iterator.h" 20 #include "cc/layer_iterator.h"
20 #include "cc/layer_tree_host.h" 21 #include "cc/layer_tree_host.h"
21 #include "cc/layer_tree_host_common.h" 22 #include "cc/layer_tree_host_common.h"
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 m_client->setNeedsCommitOnImplThread(); 693 m_client->setNeedsCommitOnImplThread();
693 } 694 }
694 695
695 void LayerTreeHostImpl::onVSyncParametersChanged(double monotonicTimebase, doubl e intervalInSeconds) 696 void LayerTreeHostImpl::onVSyncParametersChanged(double monotonicTimebase, doubl e intervalInSeconds)
696 { 697 {
697 base::TimeTicks timebase = base::TimeTicks::FromInternalValue(monotonicTimeb ase * base::Time::kMicrosecondsPerSecond); 698 base::TimeTicks timebase = base::TimeTicks::FromInternalValue(monotonicTimeb ase * base::Time::kMicrosecondsPerSecond);
698 base::TimeDelta interval = base::TimeDelta::FromMicroseconds(intervalInSecon ds * base::Time::kMicrosecondsPerSecond); 699 base::TimeDelta interval = base::TimeDelta::FromMicroseconds(intervalInSecon ds * base::Time::kMicrosecondsPerSecond);
699 m_client->onVSyncParametersChanged(timebase, interval); 700 m_client->onVSyncParametersChanged(timebase, interval);
700 } 701 }
701 702
703 CompositorFrameMetadata LayerTreeHostImpl::makeCompositorFrameMetadata() const
704 {
705 CompositorFrameMetadata metadata;
706 metadata.rootScrollOffset = m_rootScrollLayerImpl->scrollOffset() + m_rootSc rollLayerImpl->scrollDelta() + m_pinchZoomViewport.scrollDelta();
707 metadata.pageScaleFactor = m_pinchZoomViewport.totalPageScaleFactor();
708 metadata.viewportSize = m_pinchZoomViewport.bounds().size();
709 metadata.rootLayerSize = m_rootScrollLayerImpl->bounds();
710 metadata.minPageScaleFactor = m_pinchZoomViewport.minPageScaleFactor();
711 metadata.maxPageScaleFactor = m_pinchZoomViewport.maxPageScaleFactor();
712 if (!m_settings.pageScalePinchZoomEnabled) {
713 metadata.rootScrollOffset.Scale(1 / m_pinchZoomViewport.pageScaleFactor( ));
714 metadata.rootLayerSize.Scale(1 / m_pinchZoomViewport.pageScaleFactor());
715 }
716
717 return metadata;
718 }
719
702 void LayerTreeHostImpl::drawLayers(const FrameData& frame) 720 void LayerTreeHostImpl::drawLayers(const FrameData& frame)
703 { 721 {
704 TRACE_EVENT0("cc", "LayerTreeHostImpl::drawLayers"); 722 TRACE_EVENT0("cc", "LayerTreeHostImpl::drawLayers");
705 DCHECK(canDraw()); 723 DCHECK(canDraw());
706 DCHECK(!frame.renderPasses.empty()); 724 DCHECK(!frame.renderPasses.empty());
707 725
708 // FIXME: use the frame begin time from the overall compositor scheduler. 726 // FIXME: use the frame begin time from the overall compositor scheduler.
709 // This value is currently inaccessible because it is up in Chromium's 727 // This value is currently inaccessible because it is up in Chromium's
710 // RenderWidget. 728 // RenderWidget.
711 m_fpsCounter->markBeginningOfFrame(base::TimeTicks::Now()); 729 m_fpsCounter->markBeginningOfFrame(base::TimeTicks::Now());
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController(); 1523 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController();
1506 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); 1524 double monotonicTime = (time - base::TimeTicks()).InSecondsF();
1507 if (scrollbarController && scrollbarController->animate(monotonicTime)) 1525 if (scrollbarController && scrollbarController->animate(monotonicTime))
1508 m_client->setNeedsRedrawOnImplThread(); 1526 m_client->setNeedsRedrawOnImplThread();
1509 1527
1510 for (size_t i = 0; i < layer->children().size(); ++i) 1528 for (size_t i = 0; i < layer->children().size(); ++i)
1511 animateScrollbarsRecursive(layer->children()[i], time); 1529 animateScrollbarsRecursive(layer->children()[i], time);
1512 } 1530 }
1513 1531
1514 } // namespace cc 1532 } // namespace cc
OLDNEW
« cc/compositor_frame_metadata.h ('K') | « cc/layer_tree_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698