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 06b3d8db19abb4eb3bb93febd19f0299f5b5cf6b..7f2946c4fa5129bd7a640aacc6590c24a2213c21 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" |
@@ -25,6 +26,7 @@ |
#include "cc/debug/devtools_instrumentation.h" |
#include "cc/debug/frame_rate_counter.h" |
#include "cc/debug/paint_time_counter.h" |
+#include "cc/debug/performance_draw_timing_counter.h" |
#include "cc/debug/rendering_stats_instrumentation.h" |
#include "cc/debug/traced_value.h" |
#include "cc/input/page_scale_animation.h" |
@@ -236,6 +238,7 @@ LayerTreeHostImpl::LayerTreeHostImpl( |
pinch_gesture_active_(false), |
pinch_gesture_end_should_clear_scrolling_layer_(false), |
fps_counter_(FrameRateCounter::Create(proxy_->HasImplThread())), |
+ draw_counter_(PerformanceDrawTimingCounter::Create()), |
paint_time_counter_(PaintTimeCounter::Create()), |
memory_history_(MemoryHistory::Create()), |
debug_rect_history_(DebugRectHistory::Create()), |
@@ -851,8 +854,32 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses( |
*it, |
occlusion_tracker, |
&append_quads_data); |
- } |
+ const std::vector<std::pair<int64_t, gfx::Rect> > &vec = |
enne (OOO)
2014/07/22 20:44:26
This block of code could probably just get moved i
|
+ it->draw_frame_request_rects(); |
+ if (vec.size()) { |
enne (OOO)
2014/07/22 20:44:26
style nit: early out here and continue rather than
Mike B
2014/07/25 23:09:41
Hm, to do that I need to make it a function I can
|
+ gfx::Rect viewport = it->visible_content_rect(); |
enne (OOO)
2014/07/22 20:44:26
bikeshed: This isn't the viewport, it's the viewpo
Mike B
2014/07/25 23:09:41
Gotcha, I'm just creating that variable to print o
|
+ std::cout << "[LayerTreeHostImpl] it->id() " << it->id() |
+ << " it->visible_content_rect = [" |
+ << viewport.x() << ", " << viewport.y() << ", " |
+ << viewport.right() << ", " << viewport.bottom() << "]" |
+ << std::endl; |
+ for (size_t i = 0; i < vec.size(); ++i) { |
+ int64_t rect_id = vec[i].first; |
+ bool intersects = it->visible_content_rect().Intersects( |
enne (OOO)
2014/07/22 20:44:26
visible content rect is in content space (aka laye
Mike B
2014/07/25 23:09:41
Done.
|
+ vec[i].second); |
+ std::cout << "[LayerTreeHostImpl] Target " << rect_id |
+ << (intersects ? " Intersects " : " Misses ") << " - [" |
+ << vec[i].second.x() << ", " << vec[i].second.y() << ", " |
+ << vec[i].second.width() << ", " << vec[i].second.height() |
+ << "]" << std::endl; |
+ if (intersects) { |
+ uncommitted_draw_frame_ids_.push_back( |
enne (OOO)
2014/07/22 20:44:26
This should live on the frame data too and not be
|
+ std::make_pair(active_tree_->source_frame_number(), rect_id)); |
enne (OOO)
2014/07/22 20:44:26
How does performance timeline handle getting the s
Mike B
2014/07/25 23:09:41
It gets 2 entries that have the same source frame
|
+ } |
+ } |
+ } |
+ } |
++layers_drawn; |
} |
@@ -1425,6 +1452,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_draw_frame_ids_.clear(); |
return; |
} |
@@ -1514,6 +1542,10 @@ void LayerTreeHostImpl::DrawLayers(FrameData* frame, |
DCHECK(frame->render_passes.empty()); |
frame->render_passes_by_id.clear(); |
+ draw_counter_->SaveTimeStamps(CurrentFrameTimeTicks(), |
+ uncommitted_draw_frame_ids_); |
+ uncommitted_draw_frame_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 |