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

Unified Diff: cc/gl_renderer.cc

Issue 11412255: cc: Use skia::RefPtr in place of raw pointers and SkAutoTUnref. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add webkit 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/gl_renderer.cc
diff --git a/cc/gl_renderer.cc b/cc/gl_renderer.cc
index 94f8d83124f945b5118af3f5b1d07a7bbcdc5fba..168ee7065aac67e0fa3d96e37f325a7b79d5e56e 100644
--- a/cc/gl_renderer.cc
+++ b/cc/gl_renderer.cc
@@ -400,12 +400,13 @@ static SkBitmap applyImageFilter(GLRenderer* renderer, SkImageFilter* filter, Sc
platformTextureDescription.fHeight = sourceTexture->size().height();
platformTextureDescription.fConfig = kSkia8888_GrPixelConfig;
platformTextureDescription.fTextureHandle = lock.textureId();
- SkAutoTUnref<GrTexture> texture(grContext->createPlatformTexture(platformTextureDescription));
+ skia::RefPtr<GrTexture> texture = skia::AdoptRef(grContext->createPlatformTexture(platformTextureDescription));
// Place the platform texture inside an SkBitmap.
SkBitmap source;
source.setConfig(SkBitmap::kARGB_8888_Config, sourceTexture->size().width(), sourceTexture->size().height());
- source.setPixelRef(new SkGrPixelRef(texture.get()))->unref();
+ skia::RefPtr<SkGrPixelRef> pixelRef = skia::AdoptRef(new SkGrPixelRef(texture.get()));
+ source.setPixelRef(pixelRef.get());
// Create a scratch texture for backing store.
GrTextureDesc desc;
@@ -415,7 +416,7 @@ static SkBitmap applyImageFilter(GLRenderer* renderer, SkImageFilter* filter, Sc
desc.fHeight = source.height();
desc.fConfig = kSkia8888_GrPixelConfig;
GrAutoScratchTexture scratchTexture(grContext, desc, GrContext::kExact_ScratchTexMatch);
- SkAutoTUnref<GrTexture> backingStore(scratchTexture.detach());
+ skia::RefPtr<GrTexture> backingStore = skia::AdoptRef(scratchTexture.detach());
// Create a device and canvas using that backing store.
SkGpuDevice device(grContext, backingStore.get());
@@ -533,7 +534,7 @@ void GLRenderer::drawRenderPassQuad(DrawingFrame& frame, const RenderPassDrawQua
// Apply filters to the contents texture.
SkBitmap filterBitmap;
if (renderPass->filter) {
- filterBitmap = applyImageFilter(this, renderPass->filter, contentsTexture, m_client->hasImplThread());
+ filterBitmap = applyImageFilter(this, renderPass->filter.get(), contentsTexture, m_client->hasImplThread());
} else {
filterBitmap = applyFilters(this, renderPass->filters, contentsTexture, m_client->hasImplThread());
}

Powered by Google App Engine
This is Rietveld 408576698