| 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 <windows.h> | 5 #include <windows.h> |
| 6 | 6 |
| 7 #include "gpu/command_buffer/service/gpu_scheduler.h" | 7 #include "gpu/command_buffer/service/gpu_scheduler.h" |
| 8 #include "ui/gfx/gl/gl_context.h" | 8 #include "ui/gfx/gl/gl_context.h" |
| 9 #include "ui/gfx/gl/gl_surface.h" | 9 #include "ui/gfx/gl/gl_surface.h" |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 } | 40 } |
| 41 | 41 |
| 42 if (!surface.get()) { | 42 if (!surface.get()) { |
| 43 LOG(ERROR) << "GpuScheduler::Initialize failed.\n"; | 43 LOG(ERROR) << "GpuScheduler::Initialize failed.\n"; |
| 44 Destroy(); | 44 Destroy(); |
| 45 return false; | 45 return false; |
| 46 } | 46 } |
| 47 | 47 |
| 48 // Create a GLContext and attach the surface. | 48 // Create a GLContext and attach the surface. |
| 49 scoped_ptr<gfx::GLContext> context( | 49 scoped_ptr<gfx::GLContext> context( |
| 50 gfx::GLContext::CreateGLContext(surface.release(), parent_context)); | 50 gfx::GLContext::CreateGLContext(parent_context)); |
| 51 if (!context.get()) { | 51 if (!context.get()) { |
| 52 LOG(ERROR) << "CreateGLContext failed.\n"; | 52 LOG(ERROR) << "CreateGLContext failed.\n"; |
| 53 Destroy(); | 53 Destroy(); |
| 54 return false; | 54 return false; |
| 55 } | 55 } |
| 56 | 56 |
| 57 return InitializeCommon(context.release(), | 57 return InitializeCommon(surface.release(), |
| 58 context.release(), |
| 58 size, | 59 size, |
| 59 disallowed_extensions, | 60 disallowed_extensions, |
| 60 allowed_extensions, | 61 allowed_extensions, |
| 61 attribs, | 62 attribs, |
| 62 parent_decoder, | 63 parent_decoder, |
| 63 parent_texture_id); | 64 parent_texture_id); |
| 64 } | 65 } |
| 65 | 66 |
| 66 void GpuScheduler::Destroy() { | 67 void GpuScheduler::Destroy() { |
| 67 DestroyCommon(); | 68 DestroyCommon(); |
| 68 } | 69 } |
| 69 | 70 |
| 70 void GpuScheduler::WillSwapBuffers() { | 71 void GpuScheduler::WillSwapBuffers() { |
| 71 if (wrapped_swap_buffers_callback_.get()) { | 72 if (wrapped_swap_buffers_callback_.get()) { |
| 72 wrapped_swap_buffers_callback_->Run(); | 73 wrapped_swap_buffers_callback_->Run(); |
| 73 } | 74 } |
| 74 } | 75 } |
| 75 | 76 |
| 76 } // namespace gpu | 77 } // namespace gpu |
| OLD | NEW |