OLD | NEW |
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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 SkImageInfoIsGammaCorrect(info()) && | 345 SkImageInfoIsGammaCorrect(info()) && |
346 (attachmentInfo.fColorBits != 30) | 346 (attachmentInfo.fColorBits != 30) |
347 ? kSkiaGamma8888_GrPixelConfig : kSkia8888_GrPixelConfig; | 347 ? kSkiaGamma8888_GrPixelConfig : kSkia8888_GrPixelConfig; |
348 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; | 348 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; |
349 desc.fSampleCnt = attachmentInfo.fSampleCount; | 349 desc.fSampleCnt = attachmentInfo.fSampleCount; |
350 desc.fStencilBits = attachmentInfo.fStencilBits; | 350 desc.fStencilBits = attachmentInfo.fStencilBits; |
351 GrGLint buffer; | 351 GrGLint buffer; |
352 GR_GL_GetIntegerv(interface, GR_GL_FRAMEBUFFER_BINDING, &buffer); | 352 GR_GL_GetIntegerv(interface, GR_GL_FRAMEBUFFER_BINDING, &buffer); |
353 desc.fRenderTargetHandle = buffer; | 353 desc.fRenderTargetHandle = buffer; |
354 | 354 |
355 return SkSurface::MakeFromBackendRenderTarget(grContext, desc, &fSurfaceProp
s); | 355 sk_sp<SkColorSpace> colorSpace = |
| 356 grContext->caps()->srgbSupport() && SkImageInfoIsGammaCorrect(info()) |
| 357 ? SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named) : nullptr; |
| 358 return SkSurface::MakeFromBackendRenderTarget(grContext, desc, colorSpace, &
fSurfaceProps); |
356 } | 359 } |
357 | 360 |
358 #endif | 361 #endif |
OLD | NEW |