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

Side by Side Diff: src/views/SkWindow.cpp

Issue 1919993002: Added --deepColor option to SampleApp, triggers creation of a ten-bit/channel buffer on Windows. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 7 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/utils/win/SkWGL_win.cpp ('k') | src/views/ios/SkOSWindow_iOS.mm » ('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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 const GrGLInterface* interface, GrContext* grContext) { 333 const GrGLInterface* interface, GrContext* grContext) {
334 GrBackendRenderTargetDesc desc; 334 GrBackendRenderTargetDesc desc;
335 desc.fWidth = SkScalarRoundToInt(this->width()); 335 desc.fWidth = SkScalarRoundToInt(this->width());
336 desc.fHeight = SkScalarRoundToInt(this->height()); 336 desc.fHeight = SkScalarRoundToInt(this->height());
337 // TODO: Query the actual framebuffer for sRGB capable. However, to 337 // TODO: Query the actual framebuffer for sRGB capable. However, to
338 // preserve old (fake-linear) behavior, we don't do this. Instead, rely 338 // preserve old (fake-linear) behavior, we don't do this. Instead, rely
339 // on the flag (currently driven via 'C' mode in SampleApp). 339 // on the flag (currently driven via 'C' mode in SampleApp).
340 // 340 //
341 // Also, we may not have real sRGB support (ANGLE, in particular), so check for 341 // Also, we may not have real sRGB support (ANGLE, in particular), so check for
342 // that, and fall back to L32: 342 // that, and fall back to L32:
343 desc.fConfig = grContext->caps()->srgbSupport() && SkImageInfoIsGammaCorrect (info()) 343 //
344 ? kSkiaGamma8888_GrPixelConfig 344 // ... and, if we're using a 10-bit/channel FB0, it doesn't do sRGB conversi on on write,
345 : kSkia8888_GrPixelConfig; 345 // so pretend that it's non-sRGB 8888:
346 desc.fConfig =
347 grContext->caps()->srgbSupport() &&
348 SkImageInfoIsGammaCorrect(info()) &&
349 (attachmentInfo.fColorBits != 30)
350 ? kSkiaGamma8888_GrPixelConfig : kSkia8888_GrPixelConfig;
346 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; 351 desc.fOrigin = kBottomLeft_GrSurfaceOrigin;
347 desc.fSampleCnt = attachmentInfo.fSampleCount; 352 desc.fSampleCnt = attachmentInfo.fSampleCount;
348 desc.fStencilBits = attachmentInfo.fStencilBits; 353 desc.fStencilBits = attachmentInfo.fStencilBits;
349 GrGLint buffer; 354 GrGLint buffer;
350 GR_GL_GetIntegerv(interface, GR_GL_FRAMEBUFFER_BINDING, &buffer); 355 GR_GL_GetIntegerv(interface, GR_GL_FRAMEBUFFER_BINDING, &buffer);
351 desc.fRenderTargetHandle = buffer; 356 desc.fRenderTargetHandle = buffer;
352 return grContext->textureProvider()->wrapBackendRenderTarget(desc); 357 return grContext->textureProvider()->wrapBackendRenderTarget(desc);
353 } 358 }
354 359
355 #endif 360 #endif
OLDNEW
« no previous file with comments | « src/utils/win/SkWGL_win.cpp ('k') | src/views/ios/SkOSWindow_iOS.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698