WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Use debug border color for tiles
bug-75680-20120109151514.patch (text/plain), 11.26 KB, created by
Adrienne Walker
on 2012-01-09 15:15:15 PST
(
hide
)
Description:
Use debug border color for tiles
Filename:
MIME Type:
Creator:
Adrienne Walker
Created:
2012-01-09 15:15:15 PST
Size:
11.26 KB
patch
obsolete
>Subversion Revision: 104462 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e975484f0cc5e9526f510bad9a208af863fff9bd..12acef9ef095b052580df0d58679e355b438fa19 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,31 @@ >+2012-01-09 Adrienne Walker <enne@google.com> >+ >+ [chromium] Draw debug tile borders on composited layers >+ https://bugs.webkit.org/show_bug.cgi?id=75680 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ On tiled layers, draw debug borders on the tiles themselves. By >+ default, these are one pixel wide and transparent, so should be >+ unobtrusive but informative. They are triggered when the layer itself >+ would have a debug border via the existing flags. >+ >+ Also, fix the drawDebugBorderQuad function to handle arbitrarily >+ positioned quads, not just full layer quads. Also, fix alpha issue >+ with debug borders. >+ >+ * platform/graphics/chromium/LayerRendererChromium.cpp: >+ (WebCore::LayerRendererChromium::drawDebugBorderQuad): >+ * platform/graphics/chromium/cc/CCDebugBorderDrawQuad.cpp: >+ (WebCore::CCDebugBorderDrawQuad::CCDebugBorderDrawQuad): >+ * platform/graphics/chromium/cc/CCLayerImpl.cpp: >+ (WebCore::CCLayerImpl::appendDebugBorderQuad): >+ (WebCore::CCLayerImpl::quadTransform): >+ (WebCore::CCLayerImpl::hasDebugBorders): >+ * platform/graphics/chromium/cc/CCLayerImpl.h: >+ * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp: >+ (WebCore::CCTiledLayerImpl::appendQuads): >+ > 2012-01-09 Sheriff Bot <webkit.review.bot@gmail.com> > > Unreviewed, rolling out r104418. >diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog >index eefc2f913c2a3a5ccb4bffbd88bf798ce13fb4a5..295e38b4e0d0978ba08bc0f4ad7ae63df28e5f1e 100644 >--- a/Source/WebKit/chromium/ChangeLog >+++ b/Source/WebKit/chromium/ChangeLog >@@ -1,3 +1,23 @@ >+2012-01-09 Adrienne Walker <enne@google.com> >+ >+ [chromium] Draw debug tile borders on composited layers >+ https://bugs.webkit.org/show_bug.cgi?id=75680 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ As debug borders are not a CCSetting and are instead grabbed directly >+ from each graphics layer, modify the NonCompositedContentHost to say >+ that its graphics layer has debug borders if the page settings demand >+ it. >+ >+ * src/NonCompositedContentHost.cpp: >+ (WebKit::NonCompositedContentHost::NonCompositedContentHost): >+ (WebKit::NonCompositedContentHost::setShowDebugBorders): >+ (WebKit::NonCompositedContentHost::showDebugBorders): >+ * src/NonCompositedContentHost.h: >+ * src/WebViewImpl.cpp: >+ (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): >+ > 2012-01-09 Sheriff Bot <webkit.review.bot@gmail.com> > > Unreviewed, rolling out r104418. >diff --git a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp >index daeb97f9a2ccf2a5e6ceef9e00044cc851f5a3f2..b8dd8628bb0de86dce9eb2ba44dd88ee55dd2d75 100644 >--- a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp >+++ b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp >@@ -435,13 +435,14 @@ void LayerRendererChromium::drawDebugBorderQuad(const CCDebugBorderDrawQuad* qua > ASSERT(program && program->initialized()); > GLC(context(), context()->useProgram(program->program())); > >- TransformationMatrix renderMatrix = quad->layerTransform(); > const IntRect& layerRect = quad->quadRect(); >+ TransformationMatrix renderMatrix = quad->quadTransform(); >+ renderMatrix.translate(0.5 * layerRect.width() + layerRect.x(), 0.5 * layerRect.height() + layerRect.y()); > renderMatrix.scaleNonUniform(layerRect.width(), layerRect.height()); > LayerRendererChromium::toGLMatrix(&glMatrix[0], projectionMatrix() * renderMatrix); > GLC(context(), context()->uniformMatrix4fv(program->vertexShader().matrixLocation(), false, &glMatrix[0], 1)); > >- GLC(context(), context()->uniform4f(program->fragmentShader().colorLocation(), quad->color().red() / 255.0, quad->color().green() / 255.0, quad->color().blue() / 255.0, 1)); >+ GLC(context(), context()->uniform4f(program->fragmentShader().colorLocation(), quad->color().red() / 255.0, quad->color().green() / 255.0, quad->color().blue() / 255.0, quad->color().alpha() / 255.0)); > > GLC(context(), context()->lineWidth(quad->width())); > >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.cpp >index 4056a42840d434a97730512147bb89c096ff13af..b4a71dc5f81f47627a6066edd8d7ca1b478f49d7 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.cpp >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.cpp >@@ -40,7 +40,7 @@ CCDebugBorderDrawQuad::CCDebugBorderDrawQuad(const CCSharedQuadState* sharedQuad > , m_width(width) > { > m_quadOpaque = false; >- if (m_color.alpha() != 1) >+ if (m_color.hasAlpha()) > m_needsBlending = true; > } > >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp >index 29c306068bd46a75b9cdabf82adf0ebddbfc4951..6837f0a5c86c568e893bb5b104def16620b346c1 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp >@@ -135,9 +135,7 @@ void CCLayerImpl::appendQuads(CCQuadList& quadList, const CCSharedQuadState* sha > > void CCLayerImpl::appendDebugBorderQuad(CCQuadList& quadList, const CCSharedQuadState* sharedQuadState) const > { >- if (!debugBorderColor().alpha()) >- return; >- if (debugBorderWidth() <= 0) >+ if (!hasDebugBorders()) > return; > > IntRect layerRect(IntPoint(), bounds()); >@@ -426,6 +424,11 @@ void CCLayerImpl::setDebugBorderWidth(float debugBorderWidth) > m_layerPropertyChanged = true; > } > >+bool CCLayerImpl::hasDebugBorders() const >+{ >+ return debugBorderColor().alpha() && debugBorderWidth() > 0; >+} >+ > void CCLayerImpl::setContentBounds(const IntSize& contentBounds) > { > if (m_contentBounds == contentBounds) >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h >index a18fd4420ce6bf29bb15c9464267b0c81d4c77f6..0136b01f888a11daa901f63be994f22204ce5548 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h >@@ -132,6 +132,7 @@ public: > Color debugBorderColor() const { return m_debugBorderColor; } > void setDebugBorderWidth(float); > float debugBorderWidth() const { return m_debugBorderWidth; } >+ bool hasDebugBorders() const; > > CCRenderSurface* renderSurface() const { return m_renderSurface.get(); } > void createRenderSurface(); >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp >index 6ccb40704513bd0ac23a4c4ba77fd00d66190686..5849ef1eb0f0c348b87a49518a61cc63305f92cb 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp >@@ -30,6 +30,7 @@ > #include "cc/CCTiledLayerImpl.h" > > #include "LayerRendererChromium.h" >+#include "cc/CCDebugBorderDrawQuad.h" > #include "cc/CCSolidColorDrawQuad.h" > #include "cc/CCTileDrawQuad.h" > #include <wtf/text/WTFString.h> >@@ -38,6 +39,9 @@ using namespace std; > > namespace WebCore { > >+static const int debugTileBorderWidth = 1; >+static const int debugTileBorderAlpha = 100; >+ > class ManagedTexture; > > class DrawableTile : public CCLayerTilingData::Tile { >@@ -156,6 +160,11 @@ void CCTiledLayerImpl::appendQuads(CCQuadList& quadList, const CCSharedQuadState > > const GC3Dint textureFilter = m_tiler->hasBorderTexels() ? GraphicsContext3D::LINEAR : GraphicsContext3D::NEAREST; > quadList.append(CCTileDrawQuad::create(sharedQuadState, tileRect, tile->textureId(), textureOffset, textureSize, textureFilter, contentsSwizzled(), leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA)); >+ >+ if (hasDebugBorders()) { >+ Color color(debugBorderColor().red(), debugBorderColor().green(), debugBorderColor().blue(), debugTileBorderAlpha); >+ quadList.append(CCDebugBorderDrawQuad::create(sharedQuadState, tileRect, color, debugTileBorderWidth)); >+ } > } > } > } >diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp >index c3a5bb481ab48121b63c9005ead839cddb9bcca1..edf1da7a35856c74a4113ce9915b5e1a97bfcd30 100644 >--- a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp >+++ b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp >@@ -37,6 +37,7 @@ namespace WebKit { > > NonCompositedContentHost::NonCompositedContentHost(PassOwnPtr<WebCore::LayerPainterChromium> contentPaint) > : m_contentPaint(contentPaint) >+ , m_showDebugBorders(false) > { > m_graphicsLayer = WebCore::GraphicsLayer::create(this); > #ifndef NDEBUG >@@ -143,9 +144,15 @@ void NonCompositedContentHost::paintContents(const WebCore::GraphicsLayer*, WebC > m_contentPaint->paint(context, adjustedClipRect); > } > >+void NonCompositedContentHost::setShowDebugBorders(bool showDebugBorders) >+{ >+ m_showDebugBorders = showDebugBorders; >+ m_graphicsLayer->updateDebugIndicators(); >+} >+ > bool NonCompositedContentHost::showDebugBorders() const > { >- return false; >+ return m_showDebugBorders; > } > > bool NonCompositedContentHost::showRepaintCounter() const >diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.h b/Source/WebKit/chromium/src/NonCompositedContentHost.h >index dd69581086cab0f1c31bb88241626664b72618ab..2ae85b73622b5d157ff3c3b1f38b94a9227a46b1 100644 >--- a/Source/WebKit/chromium/src/NonCompositedContentHost.h >+++ b/Source/WebKit/chromium/src/NonCompositedContentHost.h >@@ -61,6 +61,8 @@ public: > void protectVisibleTileTextures(); > WebCore::GraphicsLayer* topLevelRootLayer() const { return m_graphicsLayer.get(); } > >+ void setShowDebugBorders(bool); >+ > protected: > explicit NonCompositedContentHost(PassOwnPtr<WebCore::LayerPainterChromium> contentPaint); > >@@ -78,6 +80,7 @@ private: > OwnPtr<WebCore::LayerPainterChromium> m_contentPaint; > WebCore::IntSize m_viewportSize; > int m_layerAdjustX; >+ bool m_showDebugBorders; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp >index b9355fc8330843b51ca5c435c77b7d6431cf0268..06e92abb4f92dff9a9c192b8a26893c5f3551ea0 100644 >--- a/Source/WebKit/chromium/src/WebViewImpl.cpp >+++ b/Source/WebKit/chromium/src/WebViewImpl.cpp >@@ -2977,6 +2977,7 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) > ccSettings.partialSwapEnabled = page()->settings()->partialSwapEnabled(); > > m_nonCompositedContentHost = NonCompositedContentHost::create(WebViewImplContentPainter::create(this)); >+ m_nonCompositedContentHost->setShowDebugBorders(page()->settings()->showDebugBorders()); > m_layerTreeHost = CCLayerTreeHost::create(this, ccSettings); > if (m_layerTreeHost) { > m_layerTreeHost->setHaveWheelEventHandlers(m_haveWheelEventHandlers);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 75680
:
121445
| 121730