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

Unified Diff: cc/layer_tree_host_impl.cc

Issue 11414017: cc: handling debug settings in new LayerTreeDebugState structure (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rewrote to LayerTreeSwitches 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 side-by-side diff with in-line comments
Download patch
Index: cc/layer_tree_host_impl.cc
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index a8a3faae276bbe07ce031349488be941567726af..7eef0f8b4d7b3d580103ecd5baac9bce4cfd255a 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -12,7 +12,6 @@
#include "cc/damage_tracker.h"
#include "cc/debug_rect_history.h"
#include "cc/delay_based_time_source.h"
-#include "cc/font_atlas.h"
#include "cc/frame_rate_counter.h"
#include "cc/gl_renderer.h"
#include "cc/heads_up_display_layer_impl.h"
@@ -210,6 +209,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(const LayerTreeSettings& settings, LayerTre
, m_scrollingLayerIdFromPreviousTree(-1)
, m_scrollDeltaIsInViewportSpace(false)
, m_settings(settings)
+ , m_switches(settings.initialSwitchSettings)
, m_deviceScaleFactor(1)
, m_visible(true)
, m_contentsTexturesPurged(false)
@@ -487,9 +487,9 @@ bool LayerTreeHostImpl::calculateRenderPasses(FrameData& frame)
OcclusionTrackerImpl occlusionTracker(m_rootLayerImpl->renderSurface()->contentRect(), recordMetricsForFrame);
occlusionTracker.setMinimumTrackingSize(m_settings.minimumOcclusionTrackingSize);
- if (settings().showOccludingRects)
+ if (m_switches.showOccludingRects)
occlusionTracker.setOccludingScreenSpaceRectsContainer(&frame.occludingScreenSpaceRects);
- if (settings().showNonOccludingRects)
+ if (m_switches.showNonOccludingRects)
occlusionTracker.setNonOccludingScreenSpaceRectsContainer(&frame.nonOccludingScreenSpaceRects);
// Add quads to the Render passes in FrontToBack order to allow for testing occlusion and performing culling during the tree walk.
@@ -794,12 +794,12 @@ void LayerTreeHostImpl::drawLayers(const FrameData& frame)
// RenderWidget.
m_fpsCounter->markBeginningOfFrame(base::TimeTicks::Now());
- if (m_settings.showDebugRects())
- m_debugRectHistory->saveDebugRectsForCurrentFrame(m_rootLayerImpl.get(), *frame.renderSurfaceLayerList, frame.occludingScreenSpaceRects, frame.nonOccludingScreenSpaceRects, settings());
+ if (m_switches.showHudRects())
+ m_debugRectHistory->saveDebugRectsForCurrentFrame(m_rootLayerImpl.get(), *frame.renderSurfaceLayerList, frame.occludingScreenSpaceRects, frame.nonOccludingScreenSpaceRects, m_switches);
// Because the contents of the HUD depend on everything else in the frame, the contents
// of its texture are updated as the last thing before the frame is drawn.
- if (m_hudLayerImpl)
+ if (m_hudLayerImpl && m_switches.showHudInfo())
m_hudLayerImpl->updateHudTexture(m_resourceProvider.get());
m_renderer->drawFrame(frame.renderPasses, frame.renderPassesById);

Powered by Google App Engine
This is Rietveld 408576698