OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 } // namespace | 87 } // namespace |
88 | 88 |
89 PassRefPtr<DrawingBuffer> DrawingBuffer::create(PassOwnPtr<WebGraphicsContext3D> context, const IntSize& size, PreserveDrawingBuffer preserve, WebGraphicsContex t3D::Attributes requestedAttributes, PassRefPtr<ContextEvictionManager> contextE victionManager) | 89 PassRefPtr<DrawingBuffer> DrawingBuffer::create(PassOwnPtr<WebGraphicsContext3D> context, const IntSize& size, PreserveDrawingBuffer preserve, WebGraphicsContex t3D::Attributes requestedAttributes, PassRefPtr<ContextEvictionManager> contextE victionManager) |
90 { | 90 { |
91 ASSERT(context); | 91 ASSERT(context); |
92 OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(context.g et()); | 92 OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(context.g et()); |
93 if (!extensionsUtil) { | 93 if (!extensionsUtil) { |
94 // This might be the first time we notice that the WebGraphicsContext3D is lost. | 94 // This might be the first time we notice that the WebGraphicsContext3D is lost. |
95 return nullptr; | 95 return nullptr; |
96 } | 96 } |
97 bool multisampleSupported = extensionsUtil->supportsExtension("GL_CHROMIUM_f ramebuffer_multisample") | 97 bool multisampleSupported = (extensionsUtil->supportsExtension("GL_CHROMIUM_ framebuffer_multisample") |
98 || extensionsUtil->supportsExtension("GL_EXT_multisampled_render_to_text ure")) | |
98 && extensionsUtil->supportsExtension("GL_OES_rgb8_rgba8"); | 99 && extensionsUtil->supportsExtension("GL_OES_rgb8_rgba8"); |
99 if (multisampleSupported) { | 100 if (multisampleSupported) { |
100 extensionsUtil->ensureExtensionEnabled("GL_CHROMIUM_framebuffer_multisam ple"); | |
101 extensionsUtil->ensureExtensionEnabled("GL_OES_rgb8_rgba8"); | 101 extensionsUtil->ensureExtensionEnabled("GL_OES_rgb8_rgba8"); |
102 if (extensionsUtil->supportsExtension("GL_CHROMIUM_framebuffer_multisamp le") | |
103 extensionsUtil->ensureExtensionEnabled("GL_CHROMIUM_framebuffer_mult isample"); | |
104 else | |
105 extensionsUtil->ensureExtensionEnabled("GL_EXT_multisampled_render_t o_texture"); | |
Ken Russell (switch to Gerrit)
2014/11/05 01:36:10
This isn't syntactially correct. Please don't uplo
| |
102 } | 106 } |
103 bool packedDepthStencilSupported = extensionsUtil->supportsExtension("GL_OES _packed_depth_stencil"); | 107 bool packedDepthStencilSupported = extensionsUtil->supportsExtension("GL_OES _packed_depth_stencil"); |
104 if (packedDepthStencilSupported) | 108 if (packedDepthStencilSupported) |
105 extensionsUtil->ensureExtensionEnabled("GL_OES_packed_depth_stencil"); | 109 extensionsUtil->ensureExtensionEnabled("GL_OES_packed_depth_stencil"); |
106 bool discardFramebufferSupported = extensionsUtil->supportsExtension("GL_EXT _discard_framebuffer"); | 110 bool discardFramebufferSupported = extensionsUtil->supportsExtension("GL_EXT _discard_framebuffer"); |
107 if (discardFramebufferSupported) | 111 if (discardFramebufferSupported) |
108 extensionsUtil->ensureExtensionEnabled("GL_EXT_discard_framebuffer"); | 112 extensionsUtil->ensureExtensionEnabled("GL_EXT_discard_framebuffer"); |
109 | 113 |
110 RefPtr<DrawingBuffer> drawingBuffer = adoptRef(new DrawingBuffer(context, ex tensionsUtil.release(), multisampleSupported, packedDepthStencilSupported, disca rdFramebufferSupported, preserve, requestedAttributes, contextEvictionManager)); | 114 RefPtr<DrawingBuffer> drawingBuffer = adoptRef(new DrawingBuffer(context, ex tensionsUtil.release(), multisampleSupported, packedDepthStencilSupported, disca rdFramebufferSupported, preserve, requestedAttributes, contextEvictionManager)); |
111 if (!drawingBuffer->initialize(size)) { | 115 if (!drawingBuffer->initialize(size)) { |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1060 void DrawingBuffer::deleteChromiumImageForTexture(TextureInfo* info) | 1064 void DrawingBuffer::deleteChromiumImageForTexture(TextureInfo* info) |
1061 { | 1065 { |
1062 if (info->imageId) { | 1066 if (info->imageId) { |
1063 m_context->releaseTexImage2DCHROMIUM(GL_TEXTURE_2D, info->imageId); | 1067 m_context->releaseTexImage2DCHROMIUM(GL_TEXTURE_2D, info->imageId); |
1064 m_context->destroyImageCHROMIUM(info->imageId); | 1068 m_context->destroyImageCHROMIUM(info->imageId); |
1065 info->imageId = 0; | 1069 info->imageId = 0; |
1066 } | 1070 } |
1067 } | 1071 } |
1068 | 1072 |
1069 } // namespace blink | 1073 } // namespace blink |
OLD | NEW |