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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 397443002: [not for review] Add Draw entries to window Performance Timeline Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use damage rect not viewport rect Created 6 years, 3 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/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_unittest_no_message_loop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 2278a4ac23330a062951732300ed9ce145b70cb4..e3180989d2ad0e1822015b46844875842fcf7600 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -5,6 +5,7 @@
#include "cc/trees/layer_tree_host_impl.h"
#include <algorithm>
+#include <iostream>
#include <limits>
#include "base/basictypes.h"
@@ -27,6 +28,7 @@
#include "cc/debug/frame_rate_counter.h"
#include "cc/debug/paint_time_counter.h"
#include "cc/debug/rendering_stats_instrumentation.h"
+#include "cc/debug/smoothness_timing_tracker.h"
#include "cc/debug/traced_value.h"
#include "cc/input/page_scale_animation.h"
#include "cc/input/top_controls_manager.h"
@@ -247,6 +249,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(
pinch_gesture_active_(false),
pinch_gesture_end_should_clear_scrolling_layer_(false),
fps_counter_(FrameRateCounter::Create(proxy_->HasImplThread())),
+ smoothness_tracker_(SmoothnessTimingTracker::Create()),
paint_time_counter_(PaintTimeCounter::Create()),
memory_history_(MemoryHistory::Create()),
debug_rect_history_(DebugRectHistory::Create()),
@@ -864,8 +867,41 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses(
*it,
occlusion_tracker,
&append_quads_data);
- }
+ const std::vector<std::pair<int64_t, gfx::Rect> >& vec =
+ it->smoothness_timing_requests();
+ if (vec.size()) {
+ gfx::Rect damage =
+ root_surface->damage_tracker()->current_damage_rect();
+
+ gfx::Transform inverse_screen_space_transform(
+ gfx::Transform::kSkipInitialization);
+ if (it->screen_space_transform().GetInverse(
+ &inverse_screen_space_transform))
+ damage = gfx::ToEnclosingRect(MathUtil::ProjectClippedRect(
+ inverse_screen_space_transform,
+ root_surface->damage_tracker()->current_damage_rect()));
+
+ std::cout << "[LayerTreeHostImpl] it->id() " << it->id()
+ << " it->damage = [" << damage.x() << ", " << damage.y()
+ << ", " << damage.right() << ", " << damage.bottom() << "]"
+ << std::endl;
+ for (size_t i = 0; i < vec.size(); ++i) {
+ int64_t rect_id = vec[i].first;
+ gfx::Rect rect = gfx::ScaleToEnclosingRect(
+ vec[i].second, it->contents_scale_x(), it->contents_scale_y());
+ bool intersects = damage.Intersects(rect);
+ std::cout << "[LayerTreeHostImpl] Target " << rect_id
+ << (intersects ? " Intersects " : " Misses ") << " - ["
+ << rect.x() << ", " << rect.y() << ", " << rect.width()
+ << ", " << rect.height() << "]" << std::endl;
+ if (intersects) {
+ uncommitted_composite_ids_.push_back(
+ std::make_pair(active_tree_->source_frame_number(), rect_id));
+ }
+ }
+ }
+ }
++layers_drawn;
}
@@ -1507,6 +1543,7 @@ void LayerTreeHostImpl::DrawLayers(FrameData* frame,
TRACE_EVENT_INSTANT0("cc", "EarlyOut_NoDamage", TRACE_EVENT_SCOPE_THREAD);
DCHECK(!output_surface_->capabilities()
.draw_and_swap_full_viewport_every_frame);
+ uncommitted_composite_ids_.clear();
return;
}
@@ -1596,6 +1633,10 @@ void LayerTreeHostImpl::DrawLayers(FrameData* frame,
DCHECK(frame->render_passes.empty());
frame->render_passes_by_id.clear();
+ smoothness_tracker_->SaveTimeStamps(gfx::FrameTime::Now(),
+ uncommitted_composite_ids_);
+ uncommitted_composite_ids_.clear();
+
// The next frame should start by assuming nothing has changed, and changes
// are noted as they occur.
// TODO(boliu): If we did a temporary software renderer frame, propogate the
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_unittest_no_message_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698