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

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

Issue 1752473002: SampleApp now displays gamma-correct content in "S32" and "F16" modes. The default framebuffer is a… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « no previous file | no next file » | 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 #include "GrContext.h" 319 #include "GrContext.h"
320 #include "gl/GrGLInterface.h" 320 #include "gl/GrGLInterface.h"
321 #include "gl/GrGLUtil.h" 321 #include "gl/GrGLUtil.h"
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 desc.fConfig = kSkia8888_GrPixelConfig; 329 // TODO: Query the actual framebuffer for sRGB capable. However, to
330 // preserve old (fake-linear) behavior, we don't do this. Instead, rely
331 // on the flag (currently driven via 'C' mode in SampleApp).
332 desc.fConfig = (info().profileType() == kSRGB_SkColorProfileType ||
333 info().colorType() == kRGBA_F16_SkColorType)
334 ? kSRGBA_8888_GrPixelConfig // This may not be the right byte-order
335 : kSkia8888_GrPixelConfig;
330 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; 336 desc.fOrigin = kBottomLeft_GrSurfaceOrigin;
331 desc.fSampleCnt = attachmentInfo.fSampleCount; 337 desc.fSampleCnt = attachmentInfo.fSampleCount;
332 desc.fStencilBits = attachmentInfo.fStencilBits; 338 desc.fStencilBits = attachmentInfo.fStencilBits;
333 GrGLint buffer; 339 GrGLint buffer;
334 GR_GL_GetIntegerv(interface, GR_GL_FRAMEBUFFER_BINDING, &buffer); 340 GR_GL_GetIntegerv(interface, GR_GL_FRAMEBUFFER_BINDING, &buffer);
335 desc.fRenderTargetHandle = buffer; 341 desc.fRenderTargetHandle = buffer;
336 return grContext->textureProvider()->wrapBackendRenderTarget(desc); 342 return grContext->textureProvider()->wrapBackendRenderTarget(desc);
337 } 343 }
338 344
339 #endif 345 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698