Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/gfx/compositor/compositor.h" | 5 #include "ui/gfx/compositor/compositor.h" |
| 6 | 6 |
| 7 #include <GL/gl.h> | 7 #include <GL/gl.h> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 236 void CompositorGL::NotifyEnd() { | 236 void CompositorGL::NotifyEnd() { |
| 237 DCHECK(started_); | 237 DCHECK(started_); |
| 238 gl_context_->SwapBuffers(); | 238 gl_context_->SwapBuffers(); |
| 239 started_ = false; | 239 started_ = false; |
| 240 } | 240 } |
| 241 | 241 |
| 242 } // namespace | 242 } // namespace |
| 243 | 243 |
| 244 // static | 244 // static |
| 245 Compositor* Compositor::Create(gfx::AcceleratedWidget widget) { | 245 Compositor* Compositor::Create(gfx::AcceleratedWidget widget) { |
| 246 // The following line of code exists soley to disable IO restrictions | |
| 247 // on this thread long enough to perform the GL bindings. | |
| 248 // TODO(backer) Remove this when GL initialisation cleaned up. | |
| 249 base::ThreadRestrictions::ScopedAllowIO allow_io; | |
|
sky
2011/05/20 21:42:47
Is there a corresponding include that can be nuked
| |
| 250 // TODO(backer) Remove this when GL thread patch lands. Should be init'd | 246 // TODO(backer) Remove this when GL thread patch lands. Should be init'd |
| 251 // by the new GPU thread. | 247 // by the new GPU thread. |
| 252 // http://codereview.chromium.org/6677055/ | 248 // http://codereview.chromium.org/6677055/ |
| 253 gfx::InitializeGLBindings(gfx::kGLImplementationDesktopGL); | 249 gfx::InitializeGLBindings(gfx::kGLImplementationDesktopGL); |
| 254 gfx::GLSurfaceGLX::InitializeOneOff(); | 250 gfx::GLSurfaceGLX::InitializeOneOff(); |
| 255 | 251 |
| 256 if (gfx::GetGLImplementation() != gfx::kGLImplementationNone) | 252 if (gfx::GetGLImplementation() != gfx::kGLImplementationNone) |
| 257 return new glHidden::CompositorGL(widget); | 253 return new glHidden::CompositorGL(widget); |
| 258 return NULL; | 254 return NULL; |
| 259 } | 255 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 318 | 314 |
| 319 // static | 315 // static |
| 320 Compositor* Compositor::Create(gfx::AcceleratedWidget widget) { | 316 Compositor* Compositor::Create(gfx::AcceleratedWidget widget) { |
| 321 if (gfx::GetGLImplementation() != gfx::kGLImplementationNone) | 317 if (gfx::GetGLImplementation() != gfx::kGLImplementationNone) |
| 322 return new CompositorGL(widget); | 318 return new CompositorGL(widget); |
| 323 return NULL; | 319 return NULL; |
| 324 } | 320 } |
| 325 #endif | 321 #endif |
| 326 | 322 |
| 327 } // namespace ui | 323 } // namespace ui |
| OLD | NEW |