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

Unified Diff: src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp

Issue 14091008: Add support for GL_EXT_multisampled_render_to_texture. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGpuGL.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
===================================================================
--- src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp (revision 8935)
+++ src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp (working copy)
@@ -4,6 +4,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "gl/GrGLExtensions.h"
#include "gl/GrGLInterface.h"
#ifndef GL_GLEXT_PROTOTYPES
@@ -18,6 +19,10 @@
const GrGLInterface* GrGLCreateNativeInterface() {
static SkAutoTUnref<GrGLInterface> glInterface;
if (!glInterface.get()) {
+ GrGLExtensions extensions;
+ if (!extensions.init(kES2_GrGLBinding, glGetString, NULL, glGetIntegerv)) {
+ return NULL;
+ }
GrGLInterface* interface = new GrGLInterface;
glInterface.reset(interface);
interface->fBindingsExported = kES2_GrGLBinding;
@@ -128,10 +133,23 @@
interface->fDeleteRenderbuffers = glDeleteRenderbuffers;
interface->fFramebufferRenderbuffer = glFramebufferRenderbuffer;
interface->fFramebufferTexture2D = glFramebufferTexture2D;
+ if (extensions.has("GL_EXT_multisampled_render_to_texture")) {
+#if GL_EXT_multisampled_render_to_texture
+ interface->fFramebufferTexture2DMultisample = glFramebufferTexture2DMultisampleEXT;
+ interface->fRenderbufferStorageMultisample = glRenderbufferStorageMultisampleEXT;
+#else
+ interface->fFramebufferTexture2DMultisample = (GrGLFramebufferTexture2DMultisampleProc) eglGetProcAddress("glFramebufferTexture2DMultisampleEXT");
+ interface->fRenderbufferStorageMultisample = (GrGLRenderbufferStorageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisampleEXT");
+#endif
+ } else if (extensions.has("GL_IMG_multisampled_render_to_texture")) {
#if GL_IMG_multisampled_render_to_texture
- interface->fFramebufferTexture2DMultisample = glFramebufferTexture2DMultisampleIMG;
- interface->fRenderbufferStorageMultisample = glRenderbufferStorageMultisampleIMG;
+ interface->fFramebufferTexture2DMultisample = glFramebufferTexture2DMultisampleIMG;
+ interface->fRenderbufferStorageMultisample = glRenderbufferStorageMultisampleIMG;
+#else
+ interface->fFramebufferTexture2DMultisample = (GrGLFramebufferTexture2DMultisampleProc) eglGetProcAddress("glFramebufferTexture2DMultisampleIMG");
+ interface->fRenderbufferStorageMultisample = (GrGLRenderbufferStorageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisampleIMG");
#endif
+ }
interface->fGenFramebuffers = glGenFramebuffers;
interface->fGenRenderbuffers = glGenRenderbuffers;
interface->fGetFramebufferAttachmentParameteriv = glGetFramebufferAttachmentParameteriv;
« no previous file with comments | « src/gpu/gl/GrGpuGL.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698