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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 createFallbackBlackTextures1x1(); | 525 createFallbackBlackTextures1x1(); |
526 if (!isGLES2Compliant()) | 526 if (!isGLES2Compliant()) |
527 initVertexAttrib0(); | 527 initVertexAttrib0(); |
528 | 528 |
529 IntSize canvasSize = clampedCanvasSize(); | 529 IntSize canvasSize = clampedCanvasSize(); |
530 if (m_drawingBuffer) | 530 if (m_drawingBuffer) |
531 m_drawingBuffer->reset(canvasSize); | 531 m_drawingBuffer->reset(canvasSize); |
532 | 532 |
533 m_context->reshape(canvasSize.width(), canvasSize.height()); | 533 m_context->reshape(canvasSize.width(), canvasSize.height()); |
534 m_context->viewport(0, 0, canvasSize.width(), canvasSize.height()); | 534 m_context->viewport(0, 0, canvasSize.width(), canvasSize.height()); |
| 535 m_context->scissor(0, 0, canvasSize.width(), canvasSize.height()); |
535 | 536 |
536 m_context->setContextLostCallback(adoptPtr(new WebGLRenderingContextLostCall
back(this))); | 537 m_context->setContextLostCallback(adoptPtr(new WebGLRenderingContextLostCall
back(this))); |
537 m_context->setErrorMessageCallback(adoptPtr(new WebGLRenderingContextErrorMe
ssageCallback(this))); | 538 m_context->setErrorMessageCallback(adoptPtr(new WebGLRenderingContextErrorMe
ssageCallback(this))); |
538 } | 539 } |
539 | 540 |
540 void WebGLRenderingContext::setupFlags() | 541 void WebGLRenderingContext::setupFlags() |
541 { | 542 { |
542 ASSERT(m_context); | 543 ASSERT(m_context); |
543 | 544 |
544 Page* p = canvas()->document()->page(); | 545 Page* p = canvas()->document()->page(); |
(...skipping 5190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5735 | 5736 |
5736 IntSize WebGLRenderingContext::clampedCanvasSize() | 5737 IntSize WebGLRenderingContext::clampedCanvasSize() |
5737 { | 5738 { |
5738 return IntSize(clamp(canvas()->width(), 1, m_maxViewportDims[0]), | 5739 return IntSize(clamp(canvas()->width(), 1, m_maxViewportDims[0]), |
5739 clamp(canvas()->height(), 1, m_maxViewportDims[1])); | 5740 clamp(canvas()->height(), 1, m_maxViewportDims[1])); |
5740 } | 5741 } |
5741 | 5742 |
5742 } // namespace WebCore | 5743 } // namespace WebCore |
5743 | 5744 |
5744 #endif // ENABLE(WEBGL) | 5745 #endif // ENABLE(WEBGL) |
OLD | NEW |