Commit 99be9b5a authored by mustaq@chromium.org's avatar mustaq@chromium.org

Partially revert r181835 to fix link highlighting

The changes in LinkHighlight code in http://crrev.com/541913002 causes
the link-highlights to disappear in many cases (see the bug). Eight
changes have been committed to the same code afterwards, making it
impossible to fully revert the target CL. The partial revert here fixes
the problem.

BUG=430244

Review URL: https://codereview.chromium.org/719053004

git-svn-id: svn://svn.chromium.org/blink/trunk@185245 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 4d3444e3
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#include "core/rendering/compositing/CompositedLayerMapping.h" #include "core/rendering/compositing/CompositedLayerMapping.h"
#include "core/rendering/style/ShadowData.h" #include "core/rendering/style/ShadowData.h"
#include "platform/graphics/Color.h" #include "platform/graphics/Color.h"
#include "platform/graphics/DisplayList.h"
#include "public/platform/Platform.h" #include "public/platform/Platform.h"
#include "public/platform/WebCompositorAnimationCurve.h" #include "public/platform/WebCompositorAnimationCurve.h"
#include "public/platform/WebCompositorSupport.h" #include "public/platform/WebCompositorSupport.h"
...@@ -228,13 +227,6 @@ bool LinkHighlight::computeHighlightLayerPathAndPosition(const RenderLayerModelO ...@@ -228,13 +227,6 @@ bool LinkHighlight::computeHighlightLayerPathAndPosition(const RenderLayerModelO
bool pathHasChanged = !(newPath == m_path); bool pathHasChanged = !(newPath == m_path);
if (pathHasChanged) { if (pathHasChanged) {
m_path = newPath; m_path = newPath;
GraphicsContext gc(0);
gc.beginRecording(boundingRect);
gc.setFillColor(m_node->renderer()->style()->tapHighlightColor());
gc.fillPath(m_path);
m_displayList = gc.endRecording();
m_contentLayer->layer()->setBounds(enclosingIntRect(boundingRect).size()); m_contentLayer->layer()->setBounds(enclosingIntRect(boundingRect).size());
} }
...@@ -251,8 +243,9 @@ void LinkHighlight::paintContents(WebCanvas* canvas, const WebRect& webClipRect, ...@@ -251,8 +243,9 @@ void LinkHighlight::paintContents(WebCanvas* canvas, const WebRect& webClipRect,
GraphicsContext gc(canvas, GraphicsContext gc(canvas,
contextStatus == WebContentLayerClient::GraphicsContextEnabled ? GraphicsContext::NothingDisabled : GraphicsContext::FullyDisabled); contextStatus == WebContentLayerClient::GraphicsContextEnabled ? GraphicsContext::NothingDisabled : GraphicsContext::FullyDisabled);
IntRect clipRect(IntPoint(webClipRect.x, webClipRect.y), IntSize(webClipRect.width, webClipRect.height)); IntRect clipRect(IntPoint(webClipRect.x, webClipRect.y), IntSize(webClipRect.width, webClipRect.height));
m_displayList->setClip(clipRect); gc.clip(clipRect);
gc.drawDisplayList(m_displayList.get()); gc.setFillColor(m_node->renderer()->style()->tapHighlightColor());
gc.fillPath(m_path);
} }
void LinkHighlight::startHighlightAnimationIfNeeded() void LinkHighlight::startHighlightAnimationIfNeeded()
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
namespace blink { namespace blink {
class DisplayList;
class Node; class Node;
class RenderLayerModelObject; class RenderLayerModelObject;
struct WebRect; struct WebRect;
...@@ -84,7 +83,6 @@ private: ...@@ -84,7 +83,6 @@ private:
OwnPtr<WebContentLayer> m_contentLayer; OwnPtr<WebContentLayer> m_contentLayer;
OwnPtr<WebLayer> m_clipLayer; OwnPtr<WebLayer> m_clipLayer;
Path m_path; Path m_path;
RefPtr<DisplayList> m_displayList;
RefPtrWillBePersistent<Node> m_node; RefPtrWillBePersistent<Node> m_node;
WebViewImpl* m_owningWebViewImpl; WebViewImpl* m_owningWebViewImpl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment