Index: sky/engine/core/painting/PaintingContext.cpp |
diff --git a/sky/engine/core/painting/PaintingContext.cpp b/sky/engine/core/painting/PaintingContext.cpp |
index 0bac4898e52ba248bbd421c8bbed01ef0073a218..1ab9198e5dca7eb9f0cd9a176c947ea8c9ea0132 100644 |
--- a/sky/engine/core/painting/PaintingContext.cpp |
+++ b/sky/engine/core/painting/PaintingContext.cpp |
@@ -9,7 +9,6 @@ |
#include "sky/engine/core/dom/Element.h" |
#include "sky/engine/core/painting/PaintingTasks.h" |
#include "sky/engine/platform/geometry/IntRect.h" |
-#include "third_party/skia/include/core/SkCanvas.h" |
namespace blink { |
@@ -19,33 +18,20 @@ PassRefPtr<PaintingContext> PaintingContext::create(PassRefPtr<Element> element, |
} |
PaintingContext::PaintingContext(PassRefPtr<Element> element, const FloatSize& size) |
- : m_element(element) |
- , m_size(size) |
+ : Canvas(size) |
+ , m_element(element) |
{ |
- m_displayList = adoptRef(new DisplayList); |
- m_canvas = m_displayList->beginRecording(expandedIntSize(m_size)); |
} |
PaintingContext::~PaintingContext() |
{ |
} |
-void PaintingContext::drawCircle(double x, double y, double radius, Paint* paint) |
-{ |
- if (!m_canvas) |
- return; |
- ASSERT(paint); |
- ASSERT(m_displayList->isRecording()); |
- m_canvas->drawCircle(x, y, radius, paint->paint()); |
-} |
- |
void PaintingContext::commit() |
{ |
- if (!m_canvas) |
+ if (!isRecording()) |
return; |
- m_displayList->endRecording(); |
- m_canvas = nullptr; |
- PaintingTasks::enqueueCommit(m_element, m_displayList.release()); |
+ PaintingTasks::enqueueCommit(m_element, finishRecording()); |
m_element->document().scheduleVisualUpdate(); |
} |