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

Unified Diff: third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp

Issue 2768143002: Back PaintRecord with PaintOpBuffer instead of SkPicture (Closed)
Patch Set: More unit tests Created 3 years, 8 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
Index: third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
index 3b9c1c0d7374661fd454b718ba149e6227f347c6..278e7f28648f73d43b23c292875685a36bad7093 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
@@ -1260,7 +1260,8 @@ void GraphicsContext::setURLForRect(const KURL& link, const IntRect& destRect) {
DCHECK(m_canvas);
sk_sp<SkData> url(SkData::MakeWithCString(link.getString().utf8().data()));
- PaintCanvasAnnotateRectWithURL(m_canvas, destRect, url.get());
+ m_canvas->Annotate(PaintCanvas::AnnotationType::URL, destRect,
+ std::move(url));
}
void GraphicsContext::setURLFragmentForRect(const String& destName,
@@ -1270,7 +1271,8 @@ void GraphicsContext::setURLFragmentForRect(const String& destName,
DCHECK(m_canvas);
sk_sp<SkData> skDestName(SkData::MakeWithCString(destName.utf8().data()));
- PaintCanvasAnnotateLinkToDestination(m_canvas, rect, skDestName.get());
+ m_canvas->Annotate(PaintCanvas::AnnotationType::LINK_TO_DESTINATION, rect,
+ std::move(skDestName));
}
void GraphicsContext::setURLDestinationLocation(const String& name,
@@ -1279,9 +1281,10 @@ void GraphicsContext::setURLDestinationLocation(const String& name,
return;
DCHECK(m_canvas);
+ SkRect rect = SkRect::MakeXYWH(location.x(), location.y(), 0, 0);
sk_sp<SkData> skName(SkData::MakeWithCString(name.utf8().data()));
- PaintCanvasAnnotateNamedDestination(
- m_canvas, SkPoint::Make(location.x(), location.y()), skName.get());
+ m_canvas->Annotate(PaintCanvas::AnnotationType::NAMED_DESTINATION, rect,
+ std::move(skName));
}
void GraphicsContext::concatCTM(const AffineTransform& affine) {

Powered by Google App Engine
This is Rietveld 408576698