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

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

Issue 1690053002: Revert of Make copySurface work for texture dsts, return a bool, & add unit test. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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/GrDrawTarget.cpp ('k') | src/gpu/batches/GrCopySurfaceBatch.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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 desc.fFlags = kRenderTarget_GrSurfaceFlag; 77 desc.fFlags = kRenderTarget_GrSurfaceFlag;
78 desc.fConfig = SkImageInfo2GrPixelConfig(dstCT, kPremul_SkAlphaType, dstPT); 78 desc.fConfig = SkImageInfo2GrPixelConfig(dstCT, kPremul_SkAlphaType, dstPT);
79 79
80 GrTexture* dst = context->textureProvider()->createTexture(desc, false, null ptr, 0); 80 GrTexture* dst = context->textureProvider()->createTexture(desc, false, null ptr, 0);
81 if (nullptr == dst) { 81 if (nullptr == dst) {
82 return nullptr; 82 return nullptr;
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, 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, texture, srcRect, SkIPoint::Make(0,0)); 88 context->copySurface(dst->asRenderTarget(), texture, srcRect, SkIPoint::Make (0,0),
89 context->flushSurfaceWrites(dst); 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 = new 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
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 cachedBitmap.setImmutable(); 204 cachedBitmap.setImmutable();
205 //Add to the cache 205 //Add to the cache
206 SkBitmapCache::Add(this, bounds, cachedBitmap); 206 SkBitmapCache::Add(this, bounds, cachedBitmap);
207 207
208 dst->swap(cachedBitmap); 208 dst->swap(cachedBitmap);
209 } 209 }
210 210
211 return true; 211 return true;
212 212
213 } 213 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/batches/GrCopySurfaceBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698