| Index: sky/engine/core/painting/Canvas.cpp
|
| diff --git a/sky/engine/core/painting/Canvas.cpp b/sky/engine/core/painting/Canvas.cpp
|
| index f169066c1cb9febda8dda9c5e32aa81c63e590fe..2d722124e6f67a4df8390ef1aa18e0e07b3efd3d 100644
|
| --- a/sky/engine/core/painting/Canvas.cpp
|
| +++ b/sky/engine/core/painting/Canvas.cpp
|
| @@ -3,7 +3,7 @@
|
| // found in the LICENSE file.
|
|
|
| #include "sky/engine/config.h"
|
| -#include "sky/engine/core/painting/PictureRecorder.h"
|
| +#include "sky/engine/core/painting/Canvas.h"
|
|
|
| #include "sky/engine/core/dom/Document.h"
|
| #include "sky/engine/core/dom/Element.h"
|
| @@ -13,14 +13,6 @@
|
|
|
| namespace blink {
|
|
|
| -SkRect toSkRect(const Vector<float>& rect)
|
| -{
|
| - ASSERT(rect.size() == 4);
|
| - SkRect sk_rect;
|
| - sk_rect.set(rect[0], rect[1], rect[2], rect[3]);
|
| - return sk_rect;
|
| -}
|
| -
|
| Canvas::Canvas(const FloatSize& size)
|
| : m_size(size)
|
| {
|
| @@ -40,15 +32,12 @@ void Canvas::save()
|
| m_canvas->save();
|
| }
|
|
|
| -void Canvas::saveLayer(const Vector<float>& bounds, const Paint* paint)
|
| +void Canvas::saveLayer(const Rect& bounds, const Paint* paint)
|
| {
|
| if (!m_canvas)
|
| return;
|
| ASSERT(m_displayList->isRecording());
|
| - SkRect sk_bounds;
|
| - if (!bounds.isEmpty())
|
| - sk_bounds = toSkRect(bounds);
|
| - m_canvas->saveLayer(!bounds.isEmpty() ? &sk_bounds : nullptr,
|
| + m_canvas->saveLayer(!bounds.is_null ? &bounds.sk_rect : nullptr,
|
| paint ? &paint->paint() : nullptr);
|
| }
|
|
|
| @@ -103,12 +92,12 @@ void Canvas::concat(const Vector<float>& matrix)
|
| m_canvas->concat(sk_matrix);
|
| }
|
|
|
| -void Canvas::clipRect(const Vector<float>& rect)
|
| +void Canvas::clipRect(const Rect& rect)
|
| {
|
| if (!m_canvas)
|
| return;
|
| ASSERT(m_displayList->isRecording());
|
| - m_canvas->clipRect(toSkRect(rect));
|
| + m_canvas->clipRect(rect.sk_rect);
|
| }
|
|
|
| void Canvas::drawPicture(Picture* picture)
|
| @@ -129,22 +118,22 @@ void Canvas::drawPaint(const Paint* paint)
|
| m_canvas->drawPaint(paint->paint());
|
| }
|
|
|
| -void Canvas::drawRect(const Vector<float>& rect, const Paint* paint)
|
| +void Canvas::drawRect(const Rect& rect, const Paint* paint)
|
| {
|
| if (!m_canvas)
|
| return;
|
| ASSERT(paint);
|
| ASSERT(m_displayList->isRecording());
|
| - m_canvas->drawRect(toSkRect(rect), paint->paint());
|
| + m_canvas->drawRect(rect.sk_rect, paint->paint());
|
| }
|
|
|
| -void Canvas::drawOval(const Vector<float>& rect, const Paint* paint)
|
| +void Canvas::drawOval(const Rect& rect, const Paint* paint)
|
| {
|
| if (!m_canvas)
|
| return;
|
| ASSERT(paint);
|
| ASSERT(m_displayList->isRecording());
|
| - m_canvas->drawOval(toSkRect(rect), paint->paint());
|
| + m_canvas->drawOval(rect.sk_rect, paint->paint());
|
| }
|
|
|
| void Canvas::drawCircle(float x, float y, float radius, const Paint* paint)
|
|
|