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

Unified Diff: Source/web/LinkHighlight.cpp

Issue 541913002: Create a GraphicsContext from a DisplayList. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@display-list-changes
Patch Set: Rebased. Created 6 years, 3 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/web/LinkHighlight.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/LinkHighlight.cpp
diff --git a/Source/web/LinkHighlight.cpp b/Source/web/LinkHighlight.cpp
index 0b51e66ea6a8e6352ddde4c9bb515a6fc7a9d580..02427c9181cbe358b868d3f648e1bf9c41a09049 100644
--- a/Source/web/LinkHighlight.cpp
+++ b/Source/web/LinkHighlight.cpp
@@ -39,6 +39,7 @@
#include "core/rendering/compositing/CompositedLayerMapping.h"
#include "core/rendering/style/ShadowData.h"
#include "platform/graphics/Color.h"
+#include "platform/graphics/DisplayList.h"
#include "public/platform/Platform.h"
#include "public/platform/WebCompositorAnimationCurve.h"
#include "public/platform/WebCompositorSupport.h"
@@ -236,6 +237,13 @@ bool LinkHighlight::computeHighlightLayerPathAndPosition(RenderLayer* compositin
bool pathHasChanged = !(newPath == m_path);
if (pathHasChanged) {
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());
}
@@ -253,9 +261,8 @@ void LinkHighlight::paintContents(WebCanvas* canvas, const WebRect& webClipRect,
GraphicsContext gc(canvas,
contextStatus == WebContentLayerClient::GraphicsContextEnabled ? GraphicsContext::NothingDisabled : GraphicsContext::FullyDisabled);
IntRect clipRect(IntPoint(webClipRect.x, webClipRect.y), IntSize(webClipRect.width, webClipRect.height));
- gc.clip(clipRect);
- gc.setFillColor(m_node->renderer()->style()->tapHighlightColor());
- gc.fillPath(m_path);
+ m_displayList->setClip(clipRect);
+ gc.drawDisplayList(m_displayList.get());
}
void LinkHighlight::startHighlightAnimationIfNeeded()
« no previous file with comments | « Source/web/LinkHighlight.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698