diff options
author | vmpstr <vmpstr@chromium.org> | 2015-01-26 10:27:40 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-26 18:28:37 +0000 |
commit | 3d1d72c397c947b7d3ac6390b2a0c2b3a859b094 (patch) | |
tree | 8c7abc8d1d0e27b99f25e57cf4a23f3d85f02448 /cc/layers/layer_impl.cc | |
parent | 41e8e527f1ccf6fbdc766c79d4b3b1d272bfc884 (diff) | |
download | chromium_src-3d1d72c397c947b7d3ac6390b2a0c2b3a859b094.zip chromium_src-3d1d72c397c947b7d3ac6390b2a0c2b3a859b094.tar.gz chromium_src-3d1d72c397c947b7d3ac6390b2a0c2b3a859b094.tar.bz2 |
cc: Add frame timing request plumbing through the layers.
This patch adds frame timing request class, which contains a rect and
an id for that rect. Furthermore, it adds plumbing so that the requests
get propagated from the original Layer into both pending and active
LayerImpls. Verified using tracing that the requests appear correctly.
R=danakj, michaelblain@chromium.org
BUG=441555
Review URL: https://codereview.chromium.org/834343004
Cr-Commit-Position: refs/heads/master@{#313093}
Diffstat (limited to 'cc/layers/layer_impl.cc')
-rw-r--r-- | cc/layers/layer_impl.cc | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc index 5bef67d..d099a63 100644 --- a/cc/layers/layer_impl.cc +++ b/cc/layers/layer_impl.cc @@ -70,7 +70,8 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl, int id) needs_push_properties_(false), num_dependents_need_push_properties_(0), sorting_context_id_(0), - current_draw_mode_(DRAW_MODE_NONE) { + current_draw_mode_(DRAW_MODE_NONE), + frame_timing_requests_dirty_(false) { DCHECK_GT(layer_id_, 0); DCHECK(layer_tree_impl_); layer_tree_impl_->RegisterLayer(this); @@ -607,6 +608,11 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) { layer->SetStackingOrderChanged(stacking_order_changed_); layer->SetDebugInfo(debug_info_); + if (frame_timing_requests_dirty_) { + layer->PassFrameTimingRequests(&frame_timing_requests_); + frame_timing_requests_dirty_ = false; + } + // Reset any state that should be cleared for the next update. stacking_order_changed_ = false; update_rect_ = gfx::Rect(); @@ -1024,6 +1030,13 @@ void LayerImpl::Set3dSortingContextId(int id) { NoteLayerPropertyChangedForSubtree(); } +void LayerImpl::PassFrameTimingRequests( + std::vector<FrameTimingRequest>* requests) { + frame_timing_requests_.swap(*requests); + frame_timing_requests_dirty_ = true; + SetNeedsPushProperties(); +} + void LayerImpl::SetTransform(const gfx::Transform& transform) { if (transform_ == transform) return; @@ -1552,6 +1565,17 @@ void LayerImpl::AsValueInto(base::debug::TracedValue* state) const { NOTREACHED(); } } + + if (!frame_timing_requests_.empty()) { + state->BeginArray("frame_timing_requests"); + for (const auto& request : frame_timing_requests_) { + state->BeginDictionary(); + state->SetInteger("request_id", request.id()); + MathUtil::AddToTracedValue("request_rect", request.rect(), state); + state->EndDictionary(); + } + state->EndArray(); + } } bool LayerImpl::IsDrawnRenderSurfaceLayerListMember() const { |