| 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 "gpu/demos/framework/window.h" | 5 #include "gpu/demos/framework/window.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "gpu/command_buffer/client/gles2_implementation.h" | 10 #include "gpu/command_buffer/client/gles2_implementation.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), | 66 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), |
| 67 decoder_.get(), | 67 decoder_.get(), |
| 68 NULL)); | 68 NULL)); |
| 69 | 69 |
| 70 decoder_->set_engine(gpu_scheduler_.get()); | 70 decoder_->set_engine(gpu_scheduler_.get()); |
| 71 | 71 |
| 72 surface_ = gfx::GLSurface::CreateViewGLSurface(false, hwnd); | 72 surface_ = gfx::GLSurface::CreateViewGLSurface(false, hwnd); |
| 73 if (!surface_.get()) | 73 if (!surface_.get()) |
| 74 return false; | 74 return false; |
| 75 | 75 |
| 76 context_ = gfx::GLContext::CreateGLContext(NULL, surface_.get()); | 76 context_ = gfx::GLContext::CreateGLContext( |
| 77 NULL, surface_.get(), gfx::PreferDiscreteGpu); |
| 77 if (!context_.get()) | 78 if (!context_.get()) |
| 78 return false; | 79 return false; |
| 79 | 80 |
| 80 std::vector<int32> attribs; | 81 std::vector<int32> attribs; |
| 81 if (!decoder_->Initialize(surface_.get(), | 82 if (!decoder_->Initialize(surface_.get(), |
| 82 context_.get(), | 83 context_.get(), |
| 83 gfx::Size(), | 84 gfx::Size(), |
| 84 gpu::gles2::DisallowedFeatures(), | 85 gpu::gles2::DisallowedFeatures(), |
| 85 NULL, | 86 NULL, |
| 86 attribs)) { | 87 attribs)) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 105 transfer_buffer.size, | 106 transfer_buffer.size, |
| 106 transfer_buffer.ptr, | 107 transfer_buffer.ptr, |
| 107 transfer_buffer_id, | 108 transfer_buffer_id, |
| 108 false, | 109 false, |
| 109 true)); | 110 true)); |
| 110 return true; | 111 return true; |
| 111 } | 112 } |
| 112 | 113 |
| 113 } // namespace demos | 114 } // namespace demos |
| 114 } // namespace gpu | 115 } // namespace gpu |
| OLD | NEW |