| 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_gl.h" | 5 #include "ui/gfx/compositor/compositor_gl.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 gfx::GLSurface* surface) { | 307 gfx::GLSurface* surface) { |
| 308 if (initialized_) | 308 if (initialized_) |
| 309 return gfx::GLContext::CreateGLContext( | 309 return gfx::GLContext::CreateGLContext( |
| 310 context_->share_group(), | 310 context_->share_group(), |
| 311 surface, | 311 surface, |
| 312 gfx::PreferIntegratedGpu); | 312 gfx::PreferIntegratedGpu); |
| 313 else | 313 else |
| 314 return NULL; | 314 return NULL; |
| 315 } | 315 } |
| 316 | 316 |
| 317 void* SharedResources::GetDisplay() { |
| 318 return surface_->GetDisplay(); |
| 319 } |
| 320 |
| 317 TextureGL::TextureGL() : texture_id_(0) { | 321 TextureGL::TextureGL() : texture_id_(0) { |
| 318 } | 322 } |
| 319 | 323 |
| 320 TextureGL::TextureGL(const gfx::Size& size) : texture_id_(0), size_(size) { | 324 TextureGL::TextureGL(const gfx::Size& size) : texture_id_(0), size_(size) { |
| 321 } | 325 } |
| 322 | 326 |
| 323 TextureGL::~TextureGL() { | 327 TextureGL::~TextureGL() { |
| 324 if (texture_id_) { | 328 if (texture_id_) { |
| 325 SharedResources* instance = SharedResources::GetInstance(); | 329 SharedResources* instance = SharedResources::GetInstance(); |
| 326 DCHECK(instance); | 330 DCHECK(instance); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 Compositor* Compositor::Create(CompositorDelegate* owner, | 548 Compositor* Compositor::Create(CompositorDelegate* owner, |
| 545 gfx::AcceleratedWidget widget, | 549 gfx::AcceleratedWidget widget, |
| 546 const gfx::Size& size) { | 550 const gfx::Size& size) { |
| 547 if (SharedResources::GetInstance() == NULL) | 551 if (SharedResources::GetInstance() == NULL) |
| 548 return NULL; | 552 return NULL; |
| 549 else | 553 else |
| 550 return new CompositorGL(owner, widget, size); | 554 return new CompositorGL(owner, widget, size); |
| 551 } | 555 } |
| 552 | 556 |
| 553 } // namespace ui | 557 } // namespace ui |
| OLD | NEW |