| 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 |
| 11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
| 12 * | 12 * |
| 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
| 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
| 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "sky/engine/config.h" |
| 27 #include "core/html/canvas/WebGLRenderingContextBase.h" | 27 #include "sky/engine/core/html/canvas/WebGLRenderingContextBase.h" |
| 28 | 28 |
| 29 #include "bindings/core/v8/ExceptionMessages.h" | |
| 30 #include "bindings/core/v8/ExceptionState.h" | |
| 31 #include "core/dom/ExceptionCode.h" | |
| 32 #include "core/fetch/ImageResource.h" | |
| 33 #include "core/frame/LocalFrame.h" | |
| 34 #include "core/frame/Settings.h" | |
| 35 #include "core/html/HTMLCanvasElement.h" | |
| 36 #include "core/html/HTMLImageElement.h" | |
| 37 #include "core/html/ImageData.h" | |
| 38 #include "core/html/canvas/ANGLEInstancedArrays.h" | |
| 39 #include "core/html/canvas/EXTBlendMinMax.h" | |
| 40 #include "core/html/canvas/EXTFragDepth.h" | |
| 41 #include "core/html/canvas/EXTShaderTextureLOD.h" | |
| 42 #include "core/html/canvas/EXTTextureFilterAnisotropic.h" | |
| 43 #include "core/html/canvas/OESElementIndexUint.h" | |
| 44 #include "core/html/canvas/OESStandardDerivatives.h" | |
| 45 #include "core/html/canvas/OESTextureFloat.h" | |
| 46 #include "core/html/canvas/OESTextureFloatLinear.h" | |
| 47 #include "core/html/canvas/OESTextureHalfFloat.h" | |
| 48 #include "core/html/canvas/OESTextureHalfFloatLinear.h" | |
| 49 #include "core/html/canvas/OESVertexArrayObject.h" | |
| 50 #include "core/html/canvas/WebGLActiveInfo.h" | |
| 51 #include "core/html/canvas/WebGLBuffer.h" | |
| 52 #include "core/html/canvas/WebGLCompressedTextureATC.h" | |
| 53 #include "core/html/canvas/WebGLCompressedTextureETC1.h" | |
| 54 #include "core/html/canvas/WebGLCompressedTexturePVRTC.h" | |
| 55 #include "core/html/canvas/WebGLCompressedTextureS3TC.h" | |
| 56 #include "core/html/canvas/WebGLContextAttributes.h" | |
| 57 #include "core/html/canvas/WebGLContextEvent.h" | |
| 58 #include "core/html/canvas/WebGLContextGroup.h" | |
| 59 #include "core/html/canvas/WebGLDebugRendererInfo.h" | |
| 60 #include "core/html/canvas/WebGLDebugShaders.h" | |
| 61 #include "core/html/canvas/WebGLDepthTexture.h" | |
| 62 #include "core/html/canvas/WebGLDrawBuffers.h" | |
| 63 #include "core/html/canvas/WebGLFramebuffer.h" | |
| 64 #include "core/html/canvas/WebGLLoseContext.h" | |
| 65 #include "core/html/canvas/WebGLProgram.h" | |
| 66 #include "core/html/canvas/WebGLRenderbuffer.h" | |
| 67 #include "core/html/canvas/WebGLShader.h" | |
| 68 #include "core/html/canvas/WebGLShaderPrecisionFormat.h" | |
| 69 #include "core/html/canvas/WebGLSharedWebGraphicsContext3D.h" | |
| 70 #include "core/html/canvas/WebGLTexture.h" | |
| 71 #include "core/html/canvas/WebGLUniformLocation.h" | |
| 72 #include "core/inspector/ConsoleMessage.h" | |
| 73 #include "core/loader/FrameLoaderClient.h" | |
| 74 #include "core/rendering/RenderBox.h" | |
| 75 #include "platform/CheckedInt.h" | |
| 76 #include "platform/NotImplemented.h" | |
| 77 #include "gen/sky/platform/RuntimeEnabledFeatures.h" | 29 #include "gen/sky/platform/RuntimeEnabledFeatures.h" |
| 78 #include "platform/geometry/IntSize.h" | 30 #include "sky/engine/bindings/core/v8/ExceptionMessages.h" |
| 79 #include "platform/graphics/GraphicsContext.h" | 31 #include "sky/engine/bindings/core/v8/ExceptionState.h" |
| 80 #include "platform/graphics/UnacceleratedImageBufferSurface.h" | 32 #include "sky/engine/core/dom/ExceptionCode.h" |
| 81 #include "platform/graphics/gpu/DrawingBuffer.h" | 33 #include "sky/engine/core/fetch/ImageResource.h" |
| 82 #include "public/platform/Platform.h" | 34 #include "sky/engine/core/frame/LocalFrame.h" |
| 35 #include "sky/engine/core/frame/Settings.h" |
| 36 #include "sky/engine/core/html/HTMLCanvasElement.h" |
| 37 #include "sky/engine/core/html/HTMLImageElement.h" |
| 38 #include "sky/engine/core/html/ImageData.h" |
| 39 #include "sky/engine/core/html/canvas/ANGLEInstancedArrays.h" |
| 40 #include "sky/engine/core/html/canvas/EXTBlendMinMax.h" |
| 41 #include "sky/engine/core/html/canvas/EXTFragDepth.h" |
| 42 #include "sky/engine/core/html/canvas/EXTShaderTextureLOD.h" |
| 43 #include "sky/engine/core/html/canvas/EXTTextureFilterAnisotropic.h" |
| 44 #include "sky/engine/core/html/canvas/OESElementIndexUint.h" |
| 45 #include "sky/engine/core/html/canvas/OESStandardDerivatives.h" |
| 46 #include "sky/engine/core/html/canvas/OESTextureFloat.h" |
| 47 #include "sky/engine/core/html/canvas/OESTextureFloatLinear.h" |
| 48 #include "sky/engine/core/html/canvas/OESTextureHalfFloat.h" |
| 49 #include "sky/engine/core/html/canvas/OESTextureHalfFloatLinear.h" |
| 50 #include "sky/engine/core/html/canvas/OESVertexArrayObject.h" |
| 51 #include "sky/engine/core/html/canvas/WebGLActiveInfo.h" |
| 52 #include "sky/engine/core/html/canvas/WebGLBuffer.h" |
| 53 #include "sky/engine/core/html/canvas/WebGLCompressedTextureATC.h" |
| 54 #include "sky/engine/core/html/canvas/WebGLCompressedTextureETC1.h" |
| 55 #include "sky/engine/core/html/canvas/WebGLCompressedTexturePVRTC.h" |
| 56 #include "sky/engine/core/html/canvas/WebGLCompressedTextureS3TC.h" |
| 57 #include "sky/engine/core/html/canvas/WebGLContextAttributes.h" |
| 58 #include "sky/engine/core/html/canvas/WebGLContextEvent.h" |
| 59 #include "sky/engine/core/html/canvas/WebGLContextGroup.h" |
| 60 #include "sky/engine/core/html/canvas/WebGLDebugRendererInfo.h" |
| 61 #include "sky/engine/core/html/canvas/WebGLDebugShaders.h" |
| 62 #include "sky/engine/core/html/canvas/WebGLDepthTexture.h" |
| 63 #include "sky/engine/core/html/canvas/WebGLDrawBuffers.h" |
| 64 #include "sky/engine/core/html/canvas/WebGLFramebuffer.h" |
| 65 #include "sky/engine/core/html/canvas/WebGLLoseContext.h" |
| 66 #include "sky/engine/core/html/canvas/WebGLProgram.h" |
| 67 #include "sky/engine/core/html/canvas/WebGLRenderbuffer.h" |
| 68 #include "sky/engine/core/html/canvas/WebGLShader.h" |
| 69 #include "sky/engine/core/html/canvas/WebGLShaderPrecisionFormat.h" |
| 70 #include "sky/engine/core/html/canvas/WebGLSharedWebGraphicsContext3D.h" |
| 71 #include "sky/engine/core/html/canvas/WebGLTexture.h" |
| 72 #include "sky/engine/core/html/canvas/WebGLUniformLocation.h" |
| 73 #include "sky/engine/core/inspector/ConsoleMessage.h" |
| 74 #include "sky/engine/core/loader/FrameLoaderClient.h" |
| 75 #include "sky/engine/core/rendering/RenderBox.h" |
| 76 #include "sky/engine/platform/CheckedInt.h" |
| 77 #include "sky/engine/platform/NotImplemented.h" |
| 78 #include "sky/engine/platform/geometry/IntSize.h" |
| 79 #include "sky/engine/platform/graphics/GraphicsContext.h" |
| 80 #include "sky/engine/platform/graphics/UnacceleratedImageBufferSurface.h" |
| 81 #include "sky/engine/platform/graphics/gpu/DrawingBuffer.h" |
| 82 #include "sky/engine/public/platform/Platform.h" |
| 83 | 83 |
| 84 #include "wtf/PassOwnPtr.h" | 84 #include "sky/engine/wtf/PassOwnPtr.h" |
| 85 #include "wtf/Uint32Array.h" | 85 #include "sky/engine/wtf/Uint32Array.h" |
| 86 #include "wtf/text/StringBuilder.h" | 86 #include "sky/engine/wtf/text/StringBuilder.h" |
| 87 | 87 |
| 88 namespace blink { | 88 namespace blink { |
| 89 | 89 |
| 90 const double secondsBetweenRestoreAttempts = 1.0; | 90 const double secondsBetweenRestoreAttempts = 1.0; |
| 91 const int maxGLErrorsAllowedToConsole = 256; | 91 const int maxGLErrorsAllowedToConsole = 256; |
| 92 const unsigned maxGLActiveContexts = 16; | 92 const unsigned maxGLActiveContexts = 16; |
| 93 | 93 |
| 94 // FIXME: Oilpan: static vectors to heap allocated WebGLRenderingContextBase obj
ects | 94 // FIXME: Oilpan: static vectors to heap allocated WebGLRenderingContextBase obj
ects |
| 95 // are kept here. This relies on the WebGLRenderingContextBase finalization to | 95 // are kept here. This relies on the WebGLRenderingContextBase finalization to |
| 96 // explicitly retire themselves from these vectors, but it'd be preferable if | 96 // explicitly retire themselves from these vectors, but it'd be preferable if |
| (...skipping 5516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5613 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB
uffer() : 0; | 5613 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB
uffer() : 0; |
| 5614 } | 5614 } |
| 5615 #else | 5615 #else |
| 5616 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 5616 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
| 5617 { | 5617 { |
| 5618 return m_drawingBuffer.get(); | 5618 return m_drawingBuffer.get(); |
| 5619 } | 5619 } |
| 5620 #endif | 5620 #endif |
| 5621 | 5621 |
| 5622 } // namespace blink | 5622 } // namespace blink |
| OLD | NEW |