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

Unified Diff: Source/core/paint/BlockPainter.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
« no previous file with comments | « no previous file | Source/core/paint/BoxPainter.cpp » ('j') | Source/wtf/Optional.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/BlockPainter.cpp
diff --git a/Source/core/paint/BlockPainter.cpp b/Source/core/paint/BlockPainter.cpp
index 7bc94c78b5977bf5b2a4045cf9bf85dc39ecbd4b..3a67ec06232e0d334143902275ba0820194f3baa 100644
--- a/Source/core/paint/BlockPainter.cpp
+++ b/Source/core/paint/BlockPainter.cpp
@@ -21,6 +21,7 @@
#include "core/paint/ScrollRecorder.h"
#include "core/paint/ScrollableAreaPainter.h"
#include "platform/graphics/paint/ClipRecorder.h"
+#include "wtf/Optional.h"
namespace blink {
@@ -186,11 +187,11 @@ void BlockPainter::paintObject(const PaintInfo& paintInfo, const LayoutPoint& pa
{
PaintInfo scrolledPaintInfo(paintInfo);
- OwnPtr<ScrollRecorder> scrollRecorder;
+ Optional<ScrollRecorder> scrollRecorder;
if (m_layoutBlock.hasOverflowClip()) {
IntSize scrollOffset = m_layoutBlock.scrolledContentOffset();
if (m_layoutBlock.layer()->scrollsOverflow() || !scrollOffset.isZero()) {
- scrollRecorder = adoptPtr(new ScrollRecorder(*paintInfo.context, m_layoutBlock, paintPhase, scrollOffset));
+ scrollRecorder.emplace(*paintInfo.context, m_layoutBlock, paintPhase, scrollOffset);
scrolledPaintInfo.rect.move(scrollOffset);
}
}
« no previous file with comments | « no previous file | Source/core/paint/BoxPainter.cpp » ('j') | Source/wtf/Optional.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698