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

Unified Diff: cc/quad_culler.cc

Issue 11316026: cc: Create cc::DebugColors class to hold all the debugging color/width constants. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « cc/layer_impl.cc ('k') | cc/render_surface_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quad_culler.cc
diff --git a/cc/quad_culler.cc b/cc/quad_culler.cc
index 31c0c0dc6c4416d1ba8fbd9027328a8ceffbcc07..890b7dde8acba802943701ee7f06ce97eb1413d8 100644
--- a/cc/quad_culler.cc
+++ b/cc/quad_culler.cc
@@ -6,6 +6,7 @@
#include "cc/append_quads_data.h"
#include "cc/debug_border_draw_quad.h"
+#include "cc/debug_colors.h"
#include "cc/layer_impl.h"
#include "cc/occlusion_tracker.h"
#include "cc/overdraw_metrics.h"
@@ -17,12 +18,6 @@ using namespace std;
namespace cc {
-static const int debugTileBorderWidth = 1;
-static const int debugTileBorderAlpha = 120;
-static const int debugTileBorderColorRed = 160;
-static const int debugTileBorderColorGreen = 100;
-static const int debugTileBorderColorBlue = 0;
-
QuadCuller::QuadCuller(QuadList& quadList, SharedQuadStateList& sharedQuadStateList, LayerImpl* layer, const OcclusionTrackerImpl* occlusionTracker, bool showCullingWithDebugBorderQuads, bool forSurface)
: m_quadList(quadList)
, m_sharedQuadStateList(sharedQuadStateList)
@@ -44,7 +39,7 @@ SharedQuadState* QuadCuller::useSharedQuadState(scoped_ptr<SharedQuadState> shar
return m_currentSharedQuadState;
}
-static inline bool appendQuadInternal(scoped_ptr<DrawQuad> drawQuad, const gfx::Rect& culledRect, QuadList& quadList, const OcclusionTrackerImpl& occlusionTracker, bool createDebugBorderQuads)
+static inline bool appendQuadInternal(scoped_ptr<DrawQuad> drawQuad, const gfx::Rect& culledRect, QuadList& quadList, const OcclusionTrackerImpl& occlusionTracker, LayerImpl* layer, bool createDebugBorderQuads)
{
bool keepQuad = !culledRect.IsEmpty();
if (keepQuad)
@@ -55,8 +50,9 @@ static inline bool appendQuadInternal(scoped_ptr<DrawQuad> drawQuad, const gfx::
if (keepQuad) {
if (createDebugBorderQuads && !drawQuad->isDebugQuad() && drawQuad->quadVisibleRect() != drawQuad->quadRect()) {
- SkColor borderColor = SkColorSetARGB(debugTileBorderAlpha, debugTileBorderColorRed, debugTileBorderColorGreen, debugTileBorderColorBlue);
- quadList.append(DebugBorderDrawQuad::create(drawQuad->sharedQuadState(), drawQuad->quadVisibleRect(), borderColor, debugTileBorderWidth).PassAs<DrawQuad>());
+ SkColor color = DebugColors::CulledTileBorderColor();
+ float width = DebugColors::CulledTileBorderWidth(layer ? layer->layerTreeHostImpl() : NULL);
+ quadList.append(DebugBorderDrawQuad::create(drawQuad->sharedQuadState(), drawQuad->quadVisibleRect(), color, width).PassAs<DrawQuad>());
}
// Pass the quad after we're done using it.
@@ -83,7 +79,7 @@ bool QuadCuller::append(scoped_ptr<DrawQuad> drawQuad, AppendQuadsData& appendQu
appendQuadsData.hadOcclusionFromOutsideTargetSurface |= hasOcclusionFromOutsideTargetSurface;
- return appendQuadInternal(drawQuad.Pass(), culledRect, m_quadList, *m_occlusionTracker, m_showCullingWithDebugBorderQuads);
+ return appendQuadInternal(drawQuad.Pass(), culledRect, m_quadList, *m_occlusionTracker, m_layer, m_showCullingWithDebugBorderQuads);
}
} // namespace cc
« no previous file with comments | « cc/layer_impl.cc ('k') | cc/render_surface_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698