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

Side by Side Diff: src/views/win/SkOSWindow_win.cpp

Issue 319043005: Support using OpenGL ES context on desktop (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add docs Created 6 years, 5 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkTypes.h" 8 #include "SkTypes.h"
9 9
10 #if defined(SK_BUILD_FOR_WIN) 10 #if defined(SK_BUILD_FOR_WIN)
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 gTimer = SetTimer(NULL, 0, delay, sk_timer_proc); 324 gTimer = SetTimer(NULL, 0, delay, sk_timer_proc);
325 //SkDebugf("SetTimer of %d returned %d\n", delay, gTimer); 325 //SkDebugf("SetTimer of %d returned %d\n", delay, gTimer);
326 } 326 }
327 } 327 }
328 328
329 #if SK_SUPPORT_GPU 329 #if SK_SUPPORT_GPU
330 330
331 bool SkOSWindow::attachGL(int msaaSampleCount, AttachmentInfo* info) { 331 bool SkOSWindow::attachGL(int msaaSampleCount, AttachmentInfo* info) {
332 HDC dc = GetDC((HWND)fHWND); 332 HDC dc = GetDC((HWND)fHWND);
333 if (NULL == fHGLRC) { 333 if (NULL == fHGLRC) {
334 fHGLRC = SkCreateWGLContext(dc, msaaSampleCount, false); 334 fHGLRC = SkCreateWGLContext(dc, msaaSampleCount,
335 kGLPreferCompatibilityProfile_SkWGLContextRequest);
335 if (NULL == fHGLRC) { 336 if (NULL == fHGLRC) {
336 return false; 337 return false;
337 } 338 }
338 glClearStencil(0); 339 glClearStencil(0);
339 glClearColor(0, 0, 0, 0); 340 glClearColor(0, 0, 0, 0);
340 glStencilMask(0xffffffff); 341 glStencilMask(0xffffffff);
341 glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT); 342 glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
342 } 343 }
343 if (wglMakeCurrent(dc, (HGLRC)fHGLRC)) { 344 if (wglMakeCurrent(dc, (HGLRC)fHGLRC)) {
344 // use DescribePixelFormat to get the stencil bit depth. 345 // use DescribePixelFormat to get the stencil bit depth.
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 break; 610 break;
610 #endif // SK_ANGLE 611 #endif // SK_ANGLE
611 #endif // SK_SUPPORT_GPU 612 #endif // SK_SUPPORT_GPU
612 default: 613 default:
613 SkASSERT(false); 614 SkASSERT(false);
614 break; 615 break;
615 } 616 }
616 } 617 }
617 618
618 #endif 619 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698