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

Unified Diff: src/views/win/SkOSWindow_win.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/views/unix/SkOSWindow_Unix.cpp ('k') | tests/ApplyGammaTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/views/win/SkOSWindow_win.cpp
diff --git a/src/views/win/SkOSWindow_win.cpp b/src/views/win/SkOSWindow_win.cpp
index a8d05d96f73bf076186f48b28ead564603840c99..a5aafd05d1d6a5241abf76dd66ce76195b08bf79 100644
--- a/src/views/win/SkOSWindow_win.cpp
+++ b/src/views/win/SkOSWindow_win.cpp
@@ -339,10 +339,10 @@ void SkEvent::SignalQueueTimer(SkMSec delay)
#if SK_SUPPORT_GPU
-bool SkOSWindow::attachGL(int msaaSampleCount, AttachmentInfo* info) {
+bool SkOSWindow::attachGL(int msaaSampleCount, bool deepColor, AttachmentInfo* info) {
HDC dc = GetDC((HWND)fHWND);
if (NULL == fHGLRC) {
- fHGLRC = SkCreateWGLContext(dc, msaaSampleCount,
+ fHGLRC = SkCreateWGLContext(dc, msaaSampleCount, deepColor,
kGLPreferCompatibilityProfile_SkWGLContextRequest);
if (NULL == fHGLRC) {
return false;
@@ -353,11 +353,13 @@ bool SkOSWindow::attachGL(int msaaSampleCount, AttachmentInfo* info) {
glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
}
if (wglMakeCurrent(dc, (HGLRC)fHGLRC)) {
- // use DescribePixelFormat to get the stencil bit depth.
+ // use DescribePixelFormat to get the stencil and color bit depth.
int pixelFormat = GetPixelFormat(dc);
PIXELFORMATDESCRIPTOR pfd;
DescribePixelFormat(dc, pixelFormat, sizeof(pfd), &pfd);
info->fStencilBits = pfd.cStencilBits;
+ // pfd.cColorBits includes alpha, so it will be 32 in 8/8/8/8 and 10/10/10/2
+ info->fColorBits = pfd.cRedBits + pfd.cGreenBits + pfd.cBlueBits;
// Get sample count if the MSAA WGL extension is present
SkWGLExtensions extensions;
@@ -651,7 +653,8 @@ void SkOSWindow::presentCommandBuffer() {
#endif // SK_SUPPORT_GPU
// return true on success
-bool SkOSWindow::attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo* info) {
+bool SkOSWindow::attach(SkBackEndTypes attachType, int msaaSampleCount, bool deepColor,
+ AttachmentInfo* info) {
// attach doubles as "windowResize" so we need to allo
// already bound states to pass through again
@@ -665,7 +668,7 @@ bool SkOSWindow::attach(SkBackEndTypes attachType, int msaaSampleCount, Attachme
break;
#if SK_SUPPORT_GPU
case kNativeGL_BackEndType:
- result = attachGL(msaaSampleCount, info);
+ result = attachGL(msaaSampleCount, deepColor, info);
break;
#if SK_ANGLE
case kANGLE_BackEndType:
« no previous file with comments | « src/views/unix/SkOSWindow_Unix.cpp ('k') | tests/ApplyGammaTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698