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

Unified Diff: cc/render_surface_filters.cc

Issue 11418217: Add skia::RefPtr class to wrap ref counted classes from Skia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Drop TNoRef Created 8 years, 1 month 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/render_surface_filters.cc
diff --git a/cc/render_surface_filters.cc b/cc/render_surface_filters.cc
index 4b9a49d934e26023a8283f6d7ae0104611151a11..ef2f2d822b8607b3eb591d433e073c9c7199b43f 100644
--- a/cc/render_surface_filters.cc
+++ b/cc/render_surface_filters.cc
@@ -5,6 +5,7 @@
#include "cc/render_surface_filters.h"
#include "base/logging.h"
+#include "skia/ext/refptr.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/effects/SkBlurImageFilter.h"
#include "third_party/skia/include/effects/SkColorMatrixFilter.h"
@@ -246,10 +247,11 @@ public:
platformTextureDescription.fHeight = size.height();
platformTextureDescription.fConfig = kSkia8888_GrPixelConfig;
platformTextureDescription.fTextureHandle = textureId;
- SkAutoTUnref<GrTexture> texture(grContext->createPlatformTexture(platformTextureDescription));
+ skia::RefPtr<GrTexture> texture(grContext->createPlatformTexture(platformTextureDescription));
// Place the platform texture inside an SkBitmap.
m_source.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height());
- m_source.setPixelRef(new SkGrPixelRef(texture.get()))->unref();
+ skia::RefPtr<SkGrPixelRef> pixelRef = new SkGrPixelRef(texture.get());
+ m_source.setPixelRef(pixelRef.get());
}
~FilterBufferState() { }
@@ -287,7 +289,8 @@ public:
m_canvas.reset(0);
m_device.reset(0);
- m_source.setPixelRef(new SkGrPixelRef(m_scratchTextures[m_currentTexture].get()))->unref();
+ skia::RefPtr<SkGrPixelRef> pixelRef = new SkGrPixelRef(m_scratchTextures[m_currentTexture].get());
+ m_source.setPixelRef(pixelRef.get());
m_currentTexture = 1 - m_currentTexture;
}
@@ -381,7 +384,8 @@ SkBitmap RenderSurfaceFilters::apply(const WebKit::WebFilterOperations& filters,
switch (op.type()) {
case WebKit::WebFilterOperation::FilterTypeColorMatrix: {
SkPaint paint;
- paint.setColorFilter(new SkColorMatrixFilter(op.matrix()))->unref();
+ skia::RefPtr<SkColorMatrixFilter> filter = new SkColorMatrixFilter(op.matrix());
+ paint.setColorFilter(filter.get());
canvas->drawBitmap(state.source(), 0, 0, &paint);
break;
}
« no previous file with comments | « cc/render_pass_unittest.cc ('k') | cc/render_surface_impl.cc » ('j') | skia/ext/refptr.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698