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

Unified Diff: cc/render_surface_impl.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
Index: cc/render_surface_impl.cc
diff --git a/cc/render_surface_impl.cc b/cc/render_surface_impl.cc
index e28415425ac35af4417f4309bbb229c13ca486dd..60cb4d64d29b184c99def1206736a2f56d5d4b2c 100644
--- a/cc/render_surface_impl.cc
+++ b/cc/render_surface_impl.cc
@@ -10,6 +10,7 @@
#include "base/stringprintf.h"
#include "cc/damage_tracker.h"
#include "cc/debug_border_draw_quad.h"
+#include "cc/debug_colors.h"
#include "cc/delegated_renderer_layer_impl.h"
#include "cc/layer_impl.h"
#include "cc/math_util.h"
@@ -25,15 +26,6 @@ using WebKit::WebTransformationMatrix;
namespace cc {
-static const int debugSurfaceBorderWidth = 2;
-static const int debugSurfaceBorderAlpha = 100;
-static const int debugSurfaceBorderColorRed = 0;
-static const int debugSurfaceBorderColorGreen = 0;
-static const int debugSurfaceBorderColorBlue = 255;
-static const int debugReplicaBorderColorRed = 160;
-static const int debugReplicaBorderColorGreen = 0;
-static const int debugReplicaBorderColorBlue = 255;
-
RenderSurfaceImpl::RenderSurfaceImpl(LayerImpl* owningLayer)
: m_owningLayer(owningLayer)
, m_surfacePropertyChanged(false)
@@ -210,11 +202,9 @@ void RenderSurfaceImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQ
SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(SharedQuadState::create(drawTransform, m_contentRect, clippedRectInTarget, m_drawOpacity, isOpaque).Pass());
if (m_owningLayer->showDebugBorders()) {
- int red = forReplica ? debugReplicaBorderColorRed : debugSurfaceBorderColorRed;
- int green = forReplica ? debugReplicaBorderColorGreen : debugSurfaceBorderColorGreen;
- int blue = forReplica ? debugReplicaBorderColorBlue : debugSurfaceBorderColorBlue;
- SkColor color = SkColorSetARGB(debugSurfaceBorderAlpha, red, green, blue);
- quadSink.append(DebugBorderDrawQuad::create(sharedQuadState, contentRect(), color, debugSurfaceBorderWidth).PassAs<DrawQuad>(), appendQuadsData);
+ SkColor color = forReplica ? DebugColors::kSurfaceReplicaBorderColor() : DebugColors::kSurfaceBorderColor();
+ float width = forReplica ? DebugColors::kSurfaceReplicaBorderWidth(m_owningLayer->layerTreeHostImpl()) : DebugColors::kSurfaceBorderWidth(m_owningLayer->layerTreeHostImpl());
+ quadSink.append(DebugBorderDrawQuad::create(sharedQuadState, contentRect(), color, width).PassAs<DrawQuad>(), appendQuadsData);
}
// FIXME: By using the same RenderSurfaceImpl for both the content and its reflection,
« cc/debug_colors.h ('K') | « cc/quad_culler.cc ('k') | cc/tiled_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698