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

Side by Side Diff: src/image/SkImage_Gpu.cpp

Issue 13535004: Replacing 'new' with 'SkNEW_ARGS' in SkImage_Gpu (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkImage_Base.h" 8 #include "SkImage_Base.h"
9 #include "SkImagePriv.h" 9 #include "SkImagePriv.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 26 matching lines...) Expand all
37 37
38 /////////////////////////////////////////////////////////////////////////////// 38 ///////////////////////////////////////////////////////////////////////////////
39 39
40 SkImage_Gpu::SkImage_Gpu(GrTexture* texture) 40 SkImage_Gpu::SkImage_Gpu(GrTexture* texture)
41 : INHERITED(texture->width(), texture->height()) 41 : INHERITED(texture->width(), texture->height())
42 , fTexture(texture) { 42 , fTexture(texture) {
43 43
44 SkASSERT(NULL != fTexture); 44 SkASSERT(NULL != fTexture);
45 fTexture->ref(); 45 fTexture->ref();
46 fBitmap.setConfig(SkBitmap::kARGB_8888_Config, fTexture->width(), fTexture-> height()); 46 fBitmap.setConfig(SkBitmap::kARGB_8888_Config, fTexture->width(), fTexture-> height());
47 fBitmap.setPixelRef(new SkGrPixelRef(fTexture))->unref(); 47 fBitmap.setPixelRef(SkNEW_ARGS(SkGrPixelRef, (fTexture)))->unref();
48 } 48 }
49 49
50 SkImage_Gpu::~SkImage_Gpu() { 50 SkImage_Gpu::~SkImage_Gpu() {
51 SkSafeUnref(fTexture); 51 SkSafeUnref(fTexture);
52 } 52 }
53 53
54 void SkImage_Gpu::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, 54 void SkImage_Gpu::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y,
55 const SkPaint* paint) { 55 const SkPaint* paint) {
56 canvas->drawBitmap(fBitmap, x, y, paint); 56 canvas->drawBitmap(fBitmap, x, y, paint);
57 } 57 }
(...skipping 18 matching lines...) Expand all
76 return SkNEW_ARGS(SkImage_Gpu, (texture)); 76 return SkNEW_ARGS(SkImage_Gpu, (texture));
77 } 77 }
78 78
79 GrTexture* SkTextureImageGetTexture(SkImage* image) { 79 GrTexture* SkTextureImageGetTexture(SkImage* image) {
80 return ((SkImage_Gpu*)image)->getTexture(); 80 return ((SkImage_Gpu*)image)->getTexture();
81 } 81 }
82 82
83 void SkTextureImageSetTexture(SkImage* image, GrTexture* texture) { 83 void SkTextureImageSetTexture(SkImage* image, GrTexture* texture) {
84 ((SkImage_Gpu*)image)->setTexture(texture); 84 ((SkImage_Gpu*)image)->setTexture(texture);
85 } 85 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698