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

Side by Side Diff: src/gpu/SkGrPixelRef.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 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 unified diff | Download patch
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | src/gpu/batches/GrAAStrokeRectBatch.h » ('j') | 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 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 84
85 // Blink is relying on the above copy being sent to GL immediately in the ca se when the source 85 // Blink is relying on the above copy being sent to GL immediately in the ca se when the source
86 // is a WebGL canvas backing store. We could have a TODO to remove this flus h flag, but we have 86 // is a WebGL canvas backing store. We could have a TODO to remove this flus h flag, but we have
87 // a larger TODO to remove SkGrPixelRef entirely. 87 // a larger TODO to remove SkGrPixelRef entirely.
88 context->copySurface(dst->asRenderTarget(), texture, srcRect, SkIPoint::Make (0,0), 88 context->copySurface(dst->asRenderTarget(), texture, srcRect, SkIPoint::Make (0,0),
89 GrContext::kFlushWrites_PixelOp); 89 GrContext::kFlushWrites_PixelOp);
90 90
91 SkImageInfo info = SkImageInfo::Make(desc.fWidth, desc.fHeight, dstCT, kPrem ul_SkAlphaType, 91 SkImageInfo info = SkImageInfo::Make(desc.fWidth, desc.fHeight, dstCT, kPrem ul_SkAlphaType,
92 dstPT); 92 dstPT);
93 SkGrPixelRef* pixelRef = SkNEW_ARGS(SkGrPixelRef, (info, dst)); 93 SkGrPixelRef* pixelRef = new SkGrPixelRef(info, dst);
94 SkSafeUnref(dst); 94 SkSafeUnref(dst);
95 return pixelRef; 95 return pixelRef;
96 } 96 }
97 97
98 /////////////////////////////////////////////////////////////////////////////// 98 ///////////////////////////////////////////////////////////////////////////////
99 99
100 SkGrPixelRef::SkGrPixelRef(const SkImageInfo& info, GrSurface* surface) : INHERI TED(info) { 100 SkGrPixelRef::SkGrPixelRef(const SkImageInfo& info, GrSurface* surface) : INHERI TED(info) {
101 // For surfaces that are both textures and render targets, the texture owns the 101 // For surfaces that are both textures and render targets, the texture owns the
102 // render target but not vice versa. So we ref the texture to keep both aliv e for 102 // render target but not vice versa. So we ref the texture to keep both aliv e for
103 // the lifetime of this pixel ref. 103 // the lifetime of this pixel ref.
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 cachedBitmap.setImmutable(); 194 cachedBitmap.setImmutable();
195 //Add to the cache 195 //Add to the cache
196 SkBitmapCache::Add(this, bounds, cachedBitmap); 196 SkBitmapCache::Add(this, bounds, cachedBitmap);
197 197
198 dst->swap(cachedBitmap); 198 dst->swap(cachedBitmap);
199 } 199 }
200 200
201 return true; 201 return true;
202 202
203 } 203 }
OLDNEW
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | src/gpu/batches/GrAAStrokeRectBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698