Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: Source/platform/graphics/gpu/DrawingBuffer.cpp

Issue 671643005: Enable anti-alias in WebGL if only GL_EXT_multisampled_render_to_texture is supported. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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"))
Ken Russell (switch to Gerrit) 2014/10/31 23:23:42 The code in DrawingBuffer::initialize already chec
98 && extensionsUtil->supportsExtension("GL_OES_rgb8_rgba8"); 99 && extensionsUtil->supportsExtension("GL_OES_rgb8_rgba8");
99 if (multisampleSupported) { 100 if (multisampleSupported) {
Ken Russell (switch to Gerrit) 2014/11/03 22:47:52 Please factor out the call to ensureExtensionEnabl
100 extensionsUtil->ensureExtensionEnabled("GL_CHROMIUM_framebuffer_multisam ple"); 101 if (extensionsUtil->supportsExtension("GL_CHROMIUM_framebuffer_multisamp le") {
101 extensionsUtil->ensureExtensionEnabled("GL_OES_rgb8_rgba8"); 102 extensionsUtil->ensureExtensionEnabled("GL_CHROMIUM_framebuffer_mult isample");
103 extensionsUtil->ensureExtensionEnabled("GL_OES_rgb8_rgba8");
104 } else {
105 extensionsUtil->ensureExtensionEnabled("GL_EXT_multisampled_render_t o_texture");
106 extensionsUtil->ensureExtensionEnabled("GL_OES_rgb8_rgba8");
107 }
102 } 108 }
103 bool packedDepthStencilSupported = extensionsUtil->supportsExtension("GL_OES _packed_depth_stencil"); 109 bool packedDepthStencilSupported = extensionsUtil->supportsExtension("GL_OES _packed_depth_stencil");
104 if (packedDepthStencilSupported) 110 if (packedDepthStencilSupported)
105 extensionsUtil->ensureExtensionEnabled("GL_OES_packed_depth_stencil"); 111 extensionsUtil->ensureExtensionEnabled("GL_OES_packed_depth_stencil");
106 bool discardFramebufferSupported = extensionsUtil->supportsExtension("GL_EXT _discard_framebuffer"); 112 bool discardFramebufferSupported = extensionsUtil->supportsExtension("GL_EXT _discard_framebuffer");
107 if (discardFramebufferSupported) 113 if (discardFramebufferSupported)
108 extensionsUtil->ensureExtensionEnabled("GL_EXT_discard_framebuffer"); 114 extensionsUtil->ensureExtensionEnabled("GL_EXT_discard_framebuffer");
109 115
110 RefPtr<DrawingBuffer> drawingBuffer = adoptRef(new DrawingBuffer(context, ex tensionsUtil.release(), multisampleSupported, packedDepthStencilSupported, disca rdFramebufferSupported, preserve, requestedAttributes, contextEvictionManager)); 116 RefPtr<DrawingBuffer> drawingBuffer = adoptRef(new DrawingBuffer(context, ex tensionsUtil.release(), multisampleSupported, packedDepthStencilSupported, disca rdFramebufferSupported, preserve, requestedAttributes, contextEvictionManager));
111 if (!drawingBuffer->initialize(size)) { 117 if (!drawingBuffer->initialize(size)) {
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 void DrawingBuffer::deleteChromiumImageForTexture(TextureInfo* info) 1066 void DrawingBuffer::deleteChromiumImageForTexture(TextureInfo* info)
1061 { 1067 {
1062 if (info->imageId) { 1068 if (info->imageId) {
1063 m_context->releaseTexImage2DCHROMIUM(GL_TEXTURE_2D, info->imageId); 1069 m_context->releaseTexImage2DCHROMIUM(GL_TEXTURE_2D, info->imageId);
1064 m_context->destroyImageCHROMIUM(info->imageId); 1070 m_context->destroyImageCHROMIUM(info->imageId);
1065 info->imageId = 0; 1071 info->imageId = 0;
1066 } 1072 }
1067 } 1073 }
1068 1074
1069 } // namespace blink 1075 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698