OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 | 532 |
533 // Restore as soon as possible, but only when | 533 // Restore as soon as possible, but only when |
534 // the canvas is visible. | 534 // the canvas is visible. |
535 Auto | 535 Auto |
536 }; | 536 }; |
537 void loseContext(LostContextMode) override; | 537 void loseContext(LostContextMode) override; |
538 void forceLostContext(LostContextMode, AutoRecoveryMethod); | 538 void forceLostContext(LostContextMode, AutoRecoveryMethod); |
539 void forceRestoreContext(); | 539 void forceRestoreContext(); |
540 void loseContextImpl(LostContextMode, AutoRecoveryMethod); | 540 void loseContextImpl(LostContextMode, AutoRecoveryMethod); |
541 | 541 |
| 542 // Utilities to restore GL state to match the rendering context's |
| 543 // saved state. Use these after contextGL()-based state changes that |
| 544 // bypass the rendering context. |
| 545 void restoreScissorEnabled(); |
| 546 void restoreScissorBox(); |
| 547 void restoreClearColor(); |
| 548 void restoreClearDepthf(); |
| 549 void restoreClearStencil(); |
| 550 void restoreStencilMaskSeparate(); |
| 551 void restoreColorMask(); |
| 552 void restoreDepthMask(); |
| 553 |
542 gpu::gles2::GLES2Interface* contextGL() const { | 554 gpu::gles2::GLES2Interface* contextGL() const { |
543 DrawingBuffer* d = drawingBuffer(); | 555 DrawingBuffer* d = drawingBuffer(); |
544 if (!d) | 556 if (!d) |
545 return nullptr; | 557 return nullptr; |
546 return d->contextGL(); | 558 return d->contextGL(); |
547 } | 559 } |
548 WebGLContextGroup* contextGroup() const { return m_contextGroup.get(); } | 560 WebGLContextGroup* contextGroup() const { return m_contextGroup.get(); } |
549 Extensions3DUtil* extensionsUtil(); | 561 Extensions3DUtil* extensionsUtil(); |
550 | 562 |
551 void reshape(int width, int height) override; | 563 void reshape(int width, int height) override; |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 GLenum m_readBufferOfDefaultFramebuffer; | 766 GLenum m_readBufferOfDefaultFramebuffer; |
755 | 767 |
756 GLint m_packAlignment; | 768 GLint m_packAlignment; |
757 GLint m_unpackAlignment; | 769 GLint m_unpackAlignment; |
758 bool m_unpackFlipY; | 770 bool m_unpackFlipY; |
759 bool m_unpackPremultiplyAlpha; | 771 bool m_unpackPremultiplyAlpha; |
760 GLenum m_unpackColorspaceConversion; | 772 GLenum m_unpackColorspaceConversion; |
761 | 773 |
762 GLfloat m_clearColor[4]; | 774 GLfloat m_clearColor[4]; |
763 bool m_scissorEnabled; | 775 bool m_scissorEnabled; |
| 776 GLint m_scissorBox[4]; |
764 GLfloat m_clearDepth; | 777 GLfloat m_clearDepth; |
765 GLint m_clearStencil; | 778 GLint m_clearStencil; |
766 GLboolean m_colorMask[4]; | 779 GLboolean m_colorMask[4]; |
767 GLboolean m_depthMask; | 780 GLboolean m_depthMask; |
768 | 781 |
769 bool m_stencilEnabled; | 782 bool m_stencilEnabled; |
770 GLuint m_stencilMask, m_stencilMaskBack; | 783 GLuint m_stencilMask, m_stencilMaskBack; |
771 GLint m_stencilFuncRef, | 784 GLint m_stencilFuncRef, |
772 m_stencilFuncRefBack; // Note that these are the user specified values, n
ot the internal clamped value. | 785 m_stencilFuncRefBack; // Note that these are the user specified values, n
ot the internal clamped value. |
773 GLuint m_stencilFuncMask, m_stencilFuncMaskBack; | 786 GLuint m_stencilFuncMask, m_stencilFuncMaskBack; |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1510 context, | 1523 context, |
1511 context->is3d(), | 1524 context->is3d(), |
1512 context.is3d()); | 1525 context.is3d()); |
1513 | 1526 |
1514 } // namespace blink | 1527 } // namespace blink |
1515 | 1528 |
1516 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS( | 1529 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS( |
1517 blink::WebGLRenderingContextBase::TextureUnitState); | 1530 blink::WebGLRenderingContextBase::TextureUnitState); |
1518 | 1531 |
1519 #endif // WebGLRenderingContextBase_h | 1532 #endif // WebGLRenderingContextBase_h |
OLD | NEW |