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

Unified Diff: sky/engine/core/painting/Canvas.h

Issue 1216833003: Make rendering use PaintingNodes for increased efficiency. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Feedback fixes plus missing critical line that makes it work Created 5 years, 5 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: sky/engine/core/painting/Canvas.h
diff --git a/sky/engine/core/painting/Canvas.h b/sky/engine/core/painting/Canvas.h
index c1d34221e80fd7021d286ff1a274f348b1bca194..509a013b9d067e06d451713af859e64ed4329f59 100644
--- a/sky/engine/core/painting/Canvas.h
+++ b/sky/engine/core/painting/Canvas.h
@@ -10,6 +10,7 @@
#include "sky/engine/core/painting/Drawable.h"
#include "sky/engine/core/painting/Offset.h"
#include "sky/engine/core/painting/Paint.h"
+#include "sky/engine/core/painting/PaintingNode.h"
#include "sky/engine/core/painting/Picture.h"
#include "sky/engine/core/painting/PictureRecorder.h"
#include "sky/engine/core/painting/Point.h"
@@ -35,7 +36,7 @@ public:
}
static PassRefPtr<Canvas> create(PictureRecorder* recorder,
- Size& bounds,
+ Rect& bounds,
ExceptionState& es) {
ASSERT(recorder);
if (recorder->isRecording()) {
@@ -50,8 +51,7 @@ public:
// dart code catches the error, it will leak a canvas
// but it won't crash.
}
- PassRefPtr<Canvas> canvas = create(
- recorder->beginRecording(bounds.sk_size.width(), bounds.sk_size.height()));
+ PassRefPtr<Canvas> canvas = create(recorder->beginRecording(bounds));
recorder->set_canvas(canvas.get());
return canvas;
}
@@ -83,6 +83,7 @@ public:
void drawImageRect(const CanvasImage* image, Rect& src, Rect& dst, Paint* paint);
void drawPicture(Picture* picture);
void drawDrawable(Drawable* drawable);
+ void drawPaintingNode(PaintingNode* paintingNode);
SkCanvas* skCanvas() { return m_canvas; }
void clearSkCanvas() { m_canvas = nullptr; }

Powered by Google App Engine
This is Rietveld 408576698