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

Unified Diff: ui/gfx/gl/gl_context_cgl.cc

Issue 8698008: This change adds the apple software renderer as an option on Chrome/Mac. It's enabled by passing... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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
Index: ui/gfx/gl/gl_context_cgl.cc
===================================================================
--- ui/gfx/gl/gl_context_cgl.cc (revision 113194)
+++ ui/gfx/gl/gl_context_cgl.cc (working copy)
@@ -4,10 +4,12 @@
#include "ui/gfx/gl/gl_context_cgl.h"
+#include <OpenGL/CGLRenderers.h>
#include <vector>
#include "base/logging.h"
#include "ui/gfx/gl/gl_bindings.h"
+#include "ui/gfx/gl/gl_implementation.h"
#include "ui/gfx/gl/gl_surface_cgl.h"
namespace gfx {
@@ -42,6 +44,10 @@
if (using_offline_renderer) {
attribs.push_back(kCGLPFAAllowOfflineRenderers);
}
+ if (GetGLImplementation() == kGLImplementationAppleGL) {
+ attribs.push_back(kCGLPFARendererID);
+ attribs.push_back((CGLPixelFormatAttribute) kCGLRendererGenericFloatID);
Ken Russell (switch to Gerrit) 2011/12/06 19:23:47 What are the interactions with (a) the dual-GPU co
Stephen White 2011/12/06 19:49:04 Since this is strictly a software renderer, it sho
Ken Russell (switch to Gerrit) 2011/12/06 22:49:45 Sorry, there isn't currently. I don't know how to
+ }
attribs.push_back((CGLPixelFormatAttribute) 0);
CGLPixelFormatObj format;
@@ -86,16 +92,6 @@
if (IsCurrent(surface))
return true;
- if (CGLSetPBuffer(static_cast<CGLContextObj>(context_),
- static_cast<CGLPBufferObj>(surface->GetHandle()),
- 0,
- 0,
- 0) != kCGLNoError) {
- LOG(ERROR) << "Error attaching pbuffer to context.";
- Destroy();
- return false;
- }
-
if (CGLSetCurrentContext(
static_cast<CGLContextObj>(context_)) != kCGLNoError) {
LOG(ERROR) << "Unable to make gl context current.";
@@ -122,7 +118,6 @@
SetCurrent(NULL, NULL);
CGLSetCurrentContext(NULL);
- CGLSetPBuffer(static_cast<CGLContextObj>(context_), NULL, 0, 0, 0);
}
bool GLContextCGL::IsCurrent(GLSurface* surface) {
@@ -136,20 +131,6 @@
if (!native_context_is_current)
return false;
- if (surface) {
- CGLPBufferObj current_surface = NULL;
- GLenum face;
- GLint level;
- GLint screen;
- CGLGetPBuffer(static_cast<CGLContextObj>(context_),
- &current_surface,
- &face,
- &level,
- &screen);
- if (current_surface != surface->GetHandle())
- return false;
- }
-
return true;
}

Powered by Google App Engine
This is Rietveld 408576698