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

Side by Side Diff: src/views/SkWindow.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/image/SkImage_Gpu.cpp ('k') | tests/ReadPixelsTest.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 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "SkWindow.h" 8 #include "SkWindow.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkOSMenu.h" 10 #include "SkOSMenu.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 #include "SkGr.h" 322 #include "SkGr.h"
323 323
324 GrRenderTarget* SkWindow::renderTarget(const AttachmentInfo& attachmentInfo, 324 GrRenderTarget* SkWindow::renderTarget(const AttachmentInfo& attachmentInfo,
325 const GrGLInterface* interface, GrContext* grContext) { 325 const GrGLInterface* interface, GrContext* grContext) {
326 GrBackendRenderTargetDesc desc; 326 GrBackendRenderTargetDesc desc;
327 desc.fWidth = SkScalarRoundToInt(this->width()); 327 desc.fWidth = SkScalarRoundToInt(this->width());
328 desc.fHeight = SkScalarRoundToInt(this->height()); 328 desc.fHeight = SkScalarRoundToInt(this->height());
329 // TODO: Query the actual framebuffer for sRGB capable. However, to 329 // TODO: Query the actual framebuffer for sRGB capable. However, to
330 // preserve old (fake-linear) behavior, we don't do this. Instead, rely 330 // preserve old (fake-linear) behavior, we don't do this. Instead, rely
331 // on the flag (currently driven via 'C' mode in SampleApp). 331 // on the flag (currently driven via 'C' mode in SampleApp).
332 desc.fConfig = (info().profileType() == kSRGB_SkColorProfileType || 332 //
333 // Also, we may not have real sRGB support (ANGLE, in particular), so check for
334 // that, and fall back to L32:
335 desc.fConfig = grContext->caps()->srgbSupport() &&
336 (info().profileType() == kSRGB_SkColorProfileType ||
333 info().colorType() == kRGBA_F16_SkColorType) 337 info().colorType() == kRGBA_F16_SkColorType)
334 ? kSRGBA_8888_GrPixelConfig // This may not be the right byte-order 338 ? kSkiaGamma8888_GrPixelConfig
335 : kSkia8888_GrPixelConfig; 339 : kSkia8888_GrPixelConfig;
336 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; 340 desc.fOrigin = kBottomLeft_GrSurfaceOrigin;
337 desc.fSampleCnt = attachmentInfo.fSampleCount; 341 desc.fSampleCnt = attachmentInfo.fSampleCount;
338 desc.fStencilBits = attachmentInfo.fStencilBits; 342 desc.fStencilBits = attachmentInfo.fStencilBits;
339 GrGLint buffer; 343 GrGLint buffer;
340 GR_GL_GetIntegerv(interface, GR_GL_FRAMEBUFFER_BINDING, &buffer); 344 GR_GL_GetIntegerv(interface, GR_GL_FRAMEBUFFER_BINDING, &buffer);
341 desc.fRenderTargetHandle = buffer; 345 desc.fRenderTargetHandle = buffer;
342 return grContext->textureProvider()->wrapBackendRenderTarget(desc); 346 return grContext->textureProvider()->wrapBackendRenderTarget(desc);
343 } 347 }
344 348
345 #endif 349 #endif
OLDNEW
« no previous file with comments | « src/image/SkImage_Gpu.cpp ('k') | tests/ReadPixelsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698