Index: sky/engine/core/painting/Canvas.h |
diff --git a/sky/engine/core/painting/PaintingContext.h b/sky/engine/core/painting/Canvas.h |
similarity index 60% |
copy from sky/engine/core/painting/PaintingContext.h |
copy to sky/engine/core/painting/Canvas.h |
index 2c082522213f507a79707e6c1bb73e0b4388426c..8cb0b21ba530138306c792e5f647e223f0ca4e04 100644 |
--- a/sky/engine/core/painting/PaintingContext.h |
+++ b/sky/engine/core/painting/Canvas.h |
@@ -2,8 +2,8 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef SKY_ENGINE_CORE_PAINTING_PAINTINGCONTEXT_H_ |
-#define SKY_ENGINE_CORE_PAINTING_PAINTINGCONTEXT_H_ |
+#ifndef SKY_ENGINE_CORE_PAINTING_CANVAS_H_ |
+#define SKY_ENGINE_CORE_PAINTING_CANVAS_H_ |
#include "sky/engine/core/painting/Paint.h" |
#include "sky/engine/platform/graphics/DisplayList.h" |
@@ -14,22 +14,25 @@ |
namespace blink { |
class Element; |
-class PaintingContext : public RefCounted<PaintingContext>, public DartWrappable { |
+class Canvas : public RefCounted<Canvas>, public DartWrappable { |
DEFINE_WRAPPERTYPEINFO(); |
public: |
- ~PaintingContext() override; |
- static PassRefPtr<PaintingContext> create(PassRefPtr<Element> element, const FloatSize& size); |
+ Canvas(const FloatSize& size); |
+ ~Canvas() override; |
- double height() const { return m_size.height(); } |
+ // Width/Height define a culling rect which Skia may use for optimizing |
+ // out draw calls issued outside the rect. |
double width() const { return m_size.width(); } |
+ double height() const { return m_size.height(); } |
void drawCircle(double x, double y, double radius, Paint* paint); |
Matt Perry
2015/05/13 18:33:21
Skia takes these params as SkScalars, which are fl
|
- void commit(); |
-private: |
- PaintingContext(PassRefPtr<Element> element, const FloatSize& size); |
+protected: |
+ PassRefPtr<DisplayList> finishRecording(); |
- RefPtr<Element> m_element; |
+ bool isRecording() const { return m_canvas; } |
+ |
+private: |
FloatSize m_size; |
RefPtr<DisplayList> m_displayList; |
SkCanvas* m_canvas; |
@@ -37,4 +40,4 @@ private: |
} // namespace blink |
-#endif // SKY_ENGINE_CORE_PAINTING_PAINTINGCONTEXT_H_ |
+#endif // SKY_ENGINE_CORE_PAINTING_CANVAS_H_ |