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

Unified Diff: Source/core/paint/SVGRootPainter.cpp

Issue 1129793005: Replace OwnPtr with WTF::Optional for optional recorders. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: merge with master Created 5 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
Index: Source/core/paint/SVGRootPainter.cpp
diff --git a/Source/core/paint/SVGRootPainter.cpp b/Source/core/paint/SVGRootPainter.cpp
index ba4ecfe3a82f11834ac17c9c5a9942ea1b52880a..74814d5e198af55c271c4392af1ff6910b4ba53f 100644
--- a/Source/core/paint/SVGRootPainter.cpp
+++ b/Source/core/paint/SVGRootPainter.cpp
@@ -14,6 +14,7 @@
#include "core/paint/TransformRecorder.h"
#include "core/svg/SVGSVGElement.h"
#include "platform/graphics/paint/ClipRecorder.h"
+#include "wtf/Optional.h"
namespace blink {
@@ -44,10 +45,10 @@ void SVGRootPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintO
PaintInfo paintInfoBeforeFiltering(paintInfo);
// Apply initial viewport clip.
- OwnPtr<ClipRecorder> clipRecorder;
+ Optional<ClipRecorder> clipRecorder;
if (m_layoutSVGRoot.shouldApplyViewportClip()) {
// TODO(pdr): Clip the paint info cull rect here.
- clipRecorder = adoptPtr(new ClipRecorder(*paintInfoBeforeFiltering.context, m_layoutSVGRoot, paintInfoBeforeFiltering.displayItemTypeForClipping(), LayoutRect(pixelSnappedIntRect(m_layoutSVGRoot.overflowClipRect(paintOffset)))));
+ clipRecorder.emplace(*paintInfoBeforeFiltering.context, m_layoutSVGRoot, paintInfoBeforeFiltering.displayItemTypeForClipping(), LayoutRect(pixelSnappedIntRect(m_layoutSVGRoot.overflowClipRect(paintOffset))));
}
// Convert from container offsets (html layoutObjects) to a relative transform (svg layoutObjects).

Powered by Google App Engine
This is Rietveld 408576698