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

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

Issue 864383003: Remove createUncachedTexture function, attempt to recycle scratch in createTexture. (Closed) Base URL: https://skia.googlesource.com/skia.git@continue
Patch Set: Comments, fixes Created 5 years, 10 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/effects/GrConfigConversionEffect.cpp » ('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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } else { 73 } else {
74 SkASSERT(SkIRect::MakeWH(texture->width(), texture->height()).contains(* subset)); 74 SkASSERT(SkIRect::MakeWH(texture->width(), texture->height()).contains(* subset));
75 // Create a new texture that is the size of subset. 75 // Create a new texture that is the size of subset.
76 desc.fWidth = subset->width(); 76 desc.fWidth = subset->width();
77 desc.fHeight = subset->height(); 77 desc.fHeight = subset->height();
78 srcRect = *subset; 78 srcRect = *subset;
79 } 79 }
80 desc.fFlags = kRenderTarget_GrSurfaceFlag | kNoStencil_GrSurfaceFlag; 80 desc.fFlags = kRenderTarget_GrSurfaceFlag | kNoStencil_GrSurfaceFlag;
81 desc.fConfig = SkImageInfo2GrPixelConfig(dstCT, kPremul_SkAlphaType, dstPT); 81 desc.fConfig = SkImageInfo2GrPixelConfig(dstCT, kPremul_SkAlphaType, dstPT);
82 82
83 GrTexture* dst = context->createUncachedTexture(desc, NULL, 0); 83 GrTexture* dst = context->createTexture(desc, false, NULL, 0);
84 if (NULL == dst) { 84 if (NULL == dst) {
85 return NULL; 85 return NULL;
86 } 86 }
87 87
88 // Blink is relying on the above copy being sent to GL immediately in the ca se when the source 88 // Blink is relying on the above copy being sent to GL immediately in the ca se when the source
89 // is a WebGL canvas backing store. We could have a TODO to remove this flus h flag, but we have 89 // is a WebGL canvas backing store. We could have a TODO to remove this flus h flag, but we have
90 // a larger TODO to remove SkGrPixelRef entirely. 90 // a larger TODO to remove SkGrPixelRef entirely.
91 context->copySurface(dst->asRenderTarget(), texture, srcRect, SkIPoint::Make (0,0), 91 context->copySurface(dst->asRenderTarget(), texture, srcRect, SkIPoint::Make (0,0),
92 GrContext::kFlushWrites_PixelOp); 92 GrContext::kFlushWrites_PixelOp);
93 93
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 cachedBitmap.setImmutable(); 190 cachedBitmap.setImmutable();
191 //Add to the cache 191 //Add to the cache
192 SkBitmapCache::Add(this->getGenerationID(), bounds, cachedBitmap); 192 SkBitmapCache::Add(this->getGenerationID(), bounds, cachedBitmap);
193 193
194 dst->swap(cachedBitmap); 194 dst->swap(cachedBitmap);
195 } 195 }
196 196
197 return true; 197 return true;
198 198
199 } 199 }
OLDNEW
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698