Bug 923351. Make layers borders more visible. r=nical
authorNicholas Cameron <ncameron@mozilla.com>
Fri, 11 Oct 2013 06:36:24 +1300
changeset 150386 f31625242374b5976aaf14d232af1cf6d0a47e3b
parent 150385 322bcb7a90da9953d8aece87401396863c9675cc
child 150387 bcadc378309d8001b3fd96e963602492abc5a82b
push id2991
push userkwierso@gmail.com
push dateFri, 11 Oct 2013 02:10:33 +0000
treeherderfx-team@98b44fcfebb2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs923351
milestone27.0a1
Bug 923351. Make layers borders more visible. r=nical
gfx/layers/Compositor.cpp
--- a/gfx/layers/Compositor.cpp
+++ b/gfx/layers/Compositor.cpp
@@ -34,35 +34,43 @@ Compositor::AssertOnCompositorThread()
 
 void
 Compositor::DrawDiagnostics(DiagnosticFlags aFlags,
                             const gfx::Rect& rect,
                             const gfx::Rect& aClipRect,
                             const gfx::Matrix4x4& aTransform,
                             const gfx::Point& aOffset)
 {
-  if (!(mDiagnosticTypes & DIAGNOSTIC_TILE_BORDERS) && (aFlags & DIAGNOSTIC_TILE)) {
+  if ((aFlags & DIAGNOSTIC_TILE) && !(mDiagnosticTypes & DIAGNOSTIC_TILE_BORDERS)) {
+    return;
+  }
+  if ((aFlags & DIAGNOSTIC_BIGIMAGE) && !(mDiagnosticTypes & DIAGNOSTIC_BIGIMAGE_BORDERS)) {
+    return;
+  }
+  if (!mDiagnosticTypes) {
     return;
   }
 
-  if (!(mDiagnosticTypes & DIAGNOSTIC_LAYER_BORDERS)) {
-    return;
-  }
-
+#ifdef MOZ_B2G
+  int lWidth = 4;
+#elif defined(ANDROID)
+  int lWidth = 10;
+#else
   int lWidth = 2;
+#endif
   float opacity = 0.7;
 
   gfx::Color color;
   if (aFlags & DIAGNOSTIC_CONTENT) {
     color = gfx::Color(0.0, 1.0, 0.0, 1.0); // green
     if (aFlags & DIAGNOSTIC_COMPONENT_ALPHA) {
       color = gfx::Color(0.0, 1.0, 1.0, 1.0); // greenish blue
     }
   } else if (aFlags & DIAGNOSTIC_IMAGE) {
-    color = gfx::Color(0.5, 0.0, 0.0, 1.0); // red
+    color = gfx::Color(1.0, 0.0, 0.0, 1.0); // red
   } else if (aFlags & DIAGNOSTIC_COLOR) {
     color = gfx::Color(0.0, 0.0, 1.0, 1.0); // blue
   } else if (aFlags & DIAGNOSTIC_CONTAINER) {
     color = gfx::Color(0.8, 0.0, 0.8, 1.0); // purple
   }
 
   // make tile borders a bit more transparent to keep layer borders readable.
   if (aFlags & DIAGNOSTIC_TILE || aFlags & DIAGNOSTIC_BIGIMAGE) {