OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "modules/webgl/WebGL2RenderingContextBase.h" | 6 #include "modules/webgl/WebGL2RenderingContextBase.h" |
7 | 7 |
8 #include "bindings/modules/v8/WebGLAny.h" | 8 #include "bindings/modules/v8/WebGLAny.h" |
9 #include "core/html/HTMLCanvasElement.h" | 9 #include "core/html/HTMLCanvasElement.h" |
10 #include "core/html/HTMLImageElement.h" | 10 #include "core/html/HTMLImageElement.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 { | 42 { |
43 | 43 |
44 } | 44 } |
45 | 45 |
46 WebGL2RenderingContextBase::~WebGL2RenderingContextBase() | 46 WebGL2RenderingContextBase::~WebGL2RenderingContextBase() |
47 { | 47 { |
48 m_readFramebufferBinding = nullptr; | 48 m_readFramebufferBinding = nullptr; |
49 | 49 |
50 m_boundCopyReadBuffer = nullptr; | 50 m_boundCopyReadBuffer = nullptr; |
51 m_boundCopyWriteBuffer = nullptr; | 51 m_boundCopyWriteBuffer = nullptr; |
52 m_boundPixelPackBuffer = nullptr; | |
53 m_boundPixelUnpackBuffer = nullptr; | 52 m_boundPixelUnpackBuffer = nullptr; |
54 m_boundTransformFeedbackBuffer = nullptr; | 53 m_boundTransformFeedbackBuffer = nullptr; |
55 m_boundUniformBuffer = nullptr; | 54 m_boundUniformBuffer = nullptr; |
56 | 55 |
57 m_currentBooleanOcclusionQuery = nullptr; | 56 m_currentBooleanOcclusionQuery = nullptr; |
58 m_currentTransformFeedbackPrimitivesWrittenQuery = nullptr; | 57 m_currentTransformFeedbackPrimitivesWrittenQuery = nullptr; |
59 } | 58 } |
60 | 59 |
61 void WebGL2RenderingContextBase::initializeNewContext() | 60 void WebGL2RenderingContextBase::initializeNewContext() |
62 { | 61 { |
63 ASSERT(!isContextLost()); | 62 ASSERT(!isContextLost()); |
64 ASSERT(drawingBuffer()); | 63 ASSERT(drawingBuffer()); |
65 | 64 |
66 m_readFramebufferBinding = nullptr; | 65 m_readFramebufferBinding = nullptr; |
67 | 66 |
68 m_boundCopyReadBuffer = nullptr; | 67 m_boundCopyReadBuffer = nullptr; |
69 m_boundCopyWriteBuffer = nullptr; | 68 m_boundCopyWriteBuffer = nullptr; |
70 m_boundPixelPackBuffer = nullptr; | |
71 m_boundPixelUnpackBuffer = nullptr; | 69 m_boundPixelUnpackBuffer = nullptr; |
72 m_boundTransformFeedbackBuffer = nullptr; | 70 m_boundTransformFeedbackBuffer = nullptr; |
73 m_boundUniformBuffer = nullptr; | 71 m_boundUniformBuffer = nullptr; |
74 | 72 |
75 m_currentBooleanOcclusionQuery = nullptr; | 73 m_currentBooleanOcclusionQuery = nullptr; |
76 m_currentTransformFeedbackPrimitivesWrittenQuery = nullptr; | 74 m_currentTransformFeedbackPrimitivesWrittenQuery = nullptr; |
77 | 75 |
78 m_max3DTextureSize = 0; | 76 m_max3DTextureSize = 0; |
79 webContext()->getIntegerv(GL_MAX_3D_TEXTURE_SIZE, &m_max3DTextureSize); | 77 webContext()->getIntegerv(GL_MAX_3D_TEXTURE_SIZE, &m_max3DTextureSize); |
80 m_max3DTextureLevel = WebGLTexture::computeLevelCount(m_max3DTextureSize, m_
max3DTextureSize, m_max3DTextureSize); | 78 m_max3DTextureLevel = WebGLTexture::computeLevelCount(m_max3DTextureSize, m_
max3DTextureSize, m_max3DTextureSize); |
(...skipping 2362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2443 GLenum WebGL2RenderingContextBase::boundFramebufferColorFormat() | 2441 GLenum WebGL2RenderingContextBase::boundFramebufferColorFormat() |
2444 { | 2442 { |
2445 if (m_readFramebufferBinding && m_readFramebufferBinding->object()) | 2443 if (m_readFramebufferBinding && m_readFramebufferBinding->object()) |
2446 return m_readFramebufferBinding->colorBufferFormat(); | 2444 return m_readFramebufferBinding->colorBufferFormat(); |
2447 if (m_requestedAttributes.alpha()) | 2445 if (m_requestedAttributes.alpha()) |
2448 return GL_RGBA; | 2446 return GL_RGBA; |
2449 return GL_RGB; | 2447 return GL_RGB; |
2450 } | 2448 } |
2451 | 2449 |
2452 } // namespace blink | 2450 } // namespace blink |
OLD | NEW |