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

Unified Diff: cc/layers/layer_impl.cc

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/picture_layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 5bef67d23c99a6dac082b50896964399e9f22df0..d099a63321f565b2869255f185e60b2d5b4d5dc8 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 {
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/picture_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698