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

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

Issue 1789663002: sRGB support in Ganesh. Several pieces: (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Squelch assert when blurring sRGB Created 4 years, 9 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/SkGrPriv.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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 desc.fHeight = texture->height(); 68 desc.fHeight = texture->height();
69 srcRect = SkIRect::MakeWH(texture->width(), texture->height()); 69 srcRect = SkIRect::MakeWH(texture->width(), texture->height());
70 } else { 70 } else {
71 SkASSERT(SkIRect::MakeWH(texture->width(), texture->height()).contains(* subset)); 71 SkASSERT(SkIRect::MakeWH(texture->width(), texture->height()).contains(* subset));
72 // Create a new texture that is the size of subset. 72 // Create a new texture that is the size of subset.
73 desc.fWidth = subset->width(); 73 desc.fWidth = subset->width();
74 desc.fHeight = subset->height(); 74 desc.fHeight = subset->height();
75 srcRect = *subset; 75 srcRect = *subset;
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, *context->caps());
79 desc.fTextureStorageAllocator = texture->desc().fTextureStorageAllocator; 79 desc.fTextureStorageAllocator = texture->desc().fTextureStorageAllocator;
80 desc.fIsMipMapped = false; 80 desc.fIsMipMapped = false;
81 81
82 GrTexture* dst = context->textureProvider()->createTexture(desc, SkBudgeted: :kNo, nullptr, 0); 82 GrTexture* dst = context->textureProvider()->createTexture(desc, SkBudgeted: :kNo, nullptr, 0);
83 if (nullptr == dst) { 83 if (nullptr == dst) {
84 return nullptr; 84 return nullptr;
85 } 85 }
86 86
87 // Blink is relying on the above copy being sent to GL immediately in the ca se when the source 87 // Blink is relying on the above copy being sent to GL immediately in the ca se when the source
88 // is a WebGL canvas backing store. We could have a TODO to remove this flus h, but we have 88 // is a WebGL canvas backing store. We could have a TODO to remove this flus h, but we have
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 cachedBitmap.setImmutable(); 206 cachedBitmap.setImmutable();
207 //Add to the cache 207 //Add to the cache
208 SkBitmapCache::Add(this, bounds, cachedBitmap); 208 SkBitmapCache::Add(this, bounds, cachedBitmap);
209 209
210 dst->swap(cachedBitmap); 210 dst->swap(cachedBitmap);
211 } 211 }
212 212
213 return true; 213 return true;
214 214
215 } 215 }
OLDNEW
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | src/gpu/SkGrPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698