OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
4 * | 3 * |
5 * 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 |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
8 #include "SkTypes.h" | 7 #include "SkTypes.h" |
9 | 8 |
10 #if defined(SK_BUILD_FOR_WIN) | 9 #if defined(SK_BUILD_FOR_WIN) |
11 | 10 |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 } | 549 } |
551 #endif // SK_ANGLE | 550 #endif // SK_ANGLE |
552 | 551 |
553 #if SK_COMMAND_BUFFER | 552 #if SK_COMMAND_BUFFER |
554 | 553 |
555 bool SkOSWindow::attachCommandBuffer(int msaaSampleCount, AttachmentInfo* info)
{ | 554 bool SkOSWindow::attachCommandBuffer(int msaaSampleCount, AttachmentInfo* info)
{ |
556 if (!fCommandBuffer) { | 555 if (!fCommandBuffer) { |
557 fCommandBuffer = SkCommandBufferGLContext::Create((HWND)fHWND, msaaSampl
eCount); | 556 fCommandBuffer = SkCommandBufferGLContext::Create((HWND)fHWND, msaaSampl
eCount); |
558 if (!fCommandBuffer) | 557 if (!fCommandBuffer) |
559 return false; | 558 return false; |
560 | 559 |
561 SkAutoTUnref<const GrGLInterface> intf(GrGLCreateCommandBufferInterface(
)); | 560 SkAutoTUnref<const GrGLInterface> intf(GrGLCreateCommandBufferInterface(
)); |
562 if (intf) { | 561 if (intf) { |
563 COMMAND_BUFFER_GL_CALL(intf, ClearStencil(0)); | 562 COMMAND_BUFFER_GL_CALL(intf, ClearStencil(0)); |
564 COMMAND_BUFFER_GL_CALL(intf, ClearColor(0, 0, 0, 0)); | 563 COMMAND_BUFFER_GL_CALL(intf, ClearColor(0, 0, 0, 0)); |
565 COMMAND_BUFFER_GL_CALL(intf, StencilMask(0xffffffff)); | 564 COMMAND_BUFFER_GL_CALL(intf, StencilMask(0xffffffff)); |
566 COMMAND_BUFFER_GL_CALL(intf, Clear(GL_STENCIL_BUFFER_BIT |GL_COLOR_B
UFFER_BIT)); | 565 COMMAND_BUFFER_GL_CALL(intf, Clear(GL_STENCIL_BUFFER_BIT |GL_COLOR_B
UFFER_BIT)); |
567 } | 566 } |
568 } | 567 } |
569 | 568 |
570 if (fCommandBuffer->makeCurrent()) { | 569 if (fCommandBuffer->makeCurrent()) { |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 newScreenSettings.dmPelsHeight = kHeight; | 728 newScreenSettings.dmPelsHeight = kHeight; |
730 newScreenSettings.dmBitsPerPel = 32; | 729 newScreenSettings.dmBitsPerPel = 32; |
731 newScreenSettings.dmFields = DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT; | 730 newScreenSettings.dmFields = DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT; |
732 if (ChangeDisplaySettings(&newScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE
_SUCCESSFUL) { | 731 if (ChangeDisplaySettings(&newScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE
_SUCCESSFUL) { |
733 return false; | 732 return false; |
734 } | 733 } |
735 RECT WindowRect; | 734 RECT WindowRect; |
736 WindowRect.left = 0; | 735 WindowRect.left = 0; |
737 WindowRect.right = kWidth; | 736 WindowRect.right = kWidth; |
738 WindowRect.top = 0; | 737 WindowRect.top = 0; |
739 WindowRect.bottom = kHeight; | 738 WindowRect.bottom = kHeight; |
740 ShowCursor(FALSE); | 739 ShowCursor(FALSE); |
741 AdjustWindowRectEx(&WindowRect, WS_POPUP, FALSE, WS_EX_APPWINDOW); | 740 AdjustWindowRectEx(&WindowRect, WS_POPUP, FALSE, WS_EX_APPWINDOW); |
742 HWND fsHWND = CreateWindowEx( | 741 HWND fsHWND = CreateWindowEx( |
743 WS_EX_APPWINDOW, | 742 WS_EX_APPWINDOW, |
744 fWinInit.fClass, | 743 fWinInit.fClass, |
745 NULL, | 744 NULL, |
746 WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_POPUP, | 745 WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_POPUP, |
747 0, 0, WindowRect.right-WindowRect.left, WindowRect.bottom-WindowRect.top
, | 746 0, 0, WindowRect.right-WindowRect.left, WindowRect.bottom-WindowRect.top
, |
748 NULL, | 747 NULL, |
749 NULL, | 748 NULL, |
(...skipping 21 matching lines...) Expand all Loading... |
771 } | 770 } |
772 | 771 |
773 void SkOSWindow::closeWindow() { | 772 void SkOSWindow::closeWindow() { |
774 DestroyWindow((HWND)fHWND); | 773 DestroyWindow((HWND)fHWND); |
775 if (fFullscreen) { | 774 if (fFullscreen) { |
776 DestroyWindow((HWND)fSavedWindowState.fHWND); | 775 DestroyWindow((HWND)fSavedWindowState.fHWND); |
777 } | 776 } |
778 gHwndToOSWindowMap.remove(fHWND); | 777 gHwndToOSWindowMap.remove(fHWND); |
779 } | 778 } |
780 #endif | 779 #endif |
OLD | NEW |