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

Unified Diff: cc/SkPictureCanvasLayerTextureUpdater.cpp

Issue 10915065: Add PlatformPictureSkia and RecordingPlatformDeviceSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix SkProxyCanvas leak Created 8 years, 3 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: cc/SkPictureCanvasLayerTextureUpdater.cpp
diff --git a/cc/SkPictureCanvasLayerTextureUpdater.cpp b/cc/SkPictureCanvasLayerTextureUpdater.cpp
index 62026d7227c3fd6f0e796a29bf1af8af3c23f3ce..757b97a02326ff5478f10be2f3bfaf38d7772275 100644
--- a/cc/SkPictureCanvasLayerTextureUpdater.cpp
+++ b/cc/SkPictureCanvasLayerTextureUpdater.cpp
@@ -12,11 +12,13 @@
#include "LayerPainterChromium.h"
#include "SkCanvas.h"
#include "TraceEvent.h"
+#include "skia/ext/platform_picture_skia.h"
namespace cc {
SkPictureCanvasLayerTextureUpdater::SkPictureCanvasLayerTextureUpdater(PassOwnPtr<LayerPainterChromium> painter)
: CanvasLayerTextureUpdater(painter)
+ , m_picture(adoptPtr(new skia::PlatformPictureSkia))
, m_layerIsOpaque(false)
{
}
@@ -27,15 +29,15 @@ SkPictureCanvasLayerTextureUpdater::~SkPictureCanvasLayerTextureUpdater()
void SkPictureCanvasLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize&, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, CCRenderingStats& stats)
{
- SkCanvas* canvas = m_picture.beginRecording(contentRect.width(), contentRect.height());
+ SkCanvas* canvas = m_picture->beginRecording(contentRect.width(), contentRect.height());
paintContents(canvas, contentRect, contentsWidthScale, contentsHeightScale, resultingOpaqueRect, stats);
- m_picture.endRecording();
+ m_picture->endRecording();
}
void SkPictureCanvasLayerTextureUpdater::drawPicture(SkCanvas* canvas)
{
TRACE_EVENT0("cc", "SkPictureCanvasLayerTextureUpdater::drawPicture");
- canvas->drawPicture(m_picture);
+ m_picture->drawPicture(canvas);
}
void SkPictureCanvasLayerTextureUpdater::setOpaque(bool opaque)

Powered by Google App Engine
This is Rietveld 408576698