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

Unified Diff: Source/WebKit/chromium/src/LinkHighlight.cpp

Issue 15425006: Revert "Remove NonCompositedContentHost" and follow-up rebaselining. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 months 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 | « Source/WebKit/chromium/src/LinkHighlight.h ('k') | Source/WebKit/chromium/src/NonCompositedContentHost.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/src/LinkHighlight.cpp
diff --git a/Source/WebKit/chromium/src/LinkHighlight.cpp b/Source/WebKit/chromium/src/LinkHighlight.cpp
index ec65ee156815006eb98f7d67b0b8769656a3d6ea..465b0f213838b8e72b9cd7b7ca3d31d41a35f115 100644
--- a/Source/WebKit/chromium/src/LinkHighlight.cpp
+++ b/Source/WebKit/chromium/src/LinkHighlight.cpp
@@ -27,6 +27,7 @@
#include "LinkHighlight.h"
+#include "NonCompositedContentHost.h"
#include "SkMatrix44.h"
#include "WebFrameImpl.h"
#include "WebKit.h"
@@ -65,6 +66,7 @@ LinkHighlight::LinkHighlight(Node* node, WebViewImpl* owningWebViewImpl)
: m_node(node)
, m_owningWebViewImpl(owningWebViewImpl)
, m_currentGraphicsLayer(0)
+ , m_usingNonCompositedContentHost(false)
, m_geometryNeedsUpdate(false)
, m_isAnimating(false)
, m_startTime(monotonicallyIncreasingTime())
@@ -127,6 +129,13 @@ RenderLayer* LinkHighlight::computeEnclosingCompositingLayer()
return 0;
GraphicsLayerChromium* newGraphicsLayer = static_cast<GraphicsLayerChromium*>(renderLayer->backing()->graphicsLayer());
+ m_clipLayer->setSublayerTransform(SkMatrix44());
+ m_usingNonCompositedContentHost = !newGraphicsLayer->drawsContent();
+ if (m_usingNonCompositedContentHost ) {
+ m_clipLayer->setSublayerTransform(newGraphicsLayer->platformLayer()->transform());
+ newGraphicsLayer = static_cast<GraphicsLayerChromium*>(m_owningWebViewImpl->nonCompositedContentHost()->topLevelRootLayer());
+ }
+
if (m_currentGraphicsLayer != newGraphicsLayer) {
if (m_currentGraphicsLayer)
clearGraphicsLayerLinkHighlightPointer();
@@ -188,20 +197,22 @@ bool LinkHighlight::computeHighlightLayerPathAndPosition(RenderLayer* compositin
ASSERT(quads.size());
FloatRect positionAdjust;
- const RenderStyle* style = m_node->renderer()->style();
- // If we have a box shadow, and are non-relative, then must manually adjust
- // for its size.
- if (const ShadowData* shadow = style->boxShadow()) {
- int outlineSize = m_node->renderer()->outlineStyleForRepaint()->outlineSize();
- shadow->adjustRectForShadow(positionAdjust, outlineSize);
- }
+ if (!m_usingNonCompositedContentHost) {
+ const RenderStyle* style = m_node->renderer()->style();
+ // If we have a box shadow, and are non-relative, then must manually adjust
+ // for its size.
+ if (const ShadowData* shadow = style->boxShadow()) {
+ int outlineSize = m_node->renderer()->outlineStyleForRepaint()->outlineSize();
+ shadow->adjustRectForShadow(positionAdjust, outlineSize);
+ }
- // If absolute or fixed, need to subtract out our fixed positioning.
- // FIXME: should we use RenderLayer::staticBlockPosition() here instead?
- // Perhaps consider this if out-of-flow elements cause further problems.
- if (m_node->renderer()->isOutOfFlowPositioned()) {
- FloatPoint delta(style->left().getFloatValue(), style->top().getFloatValue());
- positionAdjust.moveBy(delta);
+ // If absolute or fixed, need to subtract out our fixed positioning.
+ // FIXME: should we use RenderLayer::staticBlockPosition() here instead?
+ // Perhaps consider this if out-of-flow elements cause further problems.
+ if (m_node->renderer()->isOutOfFlowPositioned()) {
+ FloatPoint delta(style->left().getFloatValue(), style->top().getFloatValue());
+ positionAdjust.moveBy(delta);
+ }
}
Path newPath;
« no previous file with comments | « Source/WebKit/chromium/src/LinkHighlight.h ('k') | Source/WebKit/chromium/src/NonCompositedContentHost.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698