| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/command_buffer/service/async_pixel_transfer_manager_egl.h" | 5 #include "gpu/command_buffer/service/async_pixel_transfer_manager_egl.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 TransferThread() : base::Thread(kAsyncTransferThreadName) { | 90 TransferThread() : base::Thread(kAsyncTransferThreadName) { |
| 91 Start(); | 91 Start(); |
| 92 #if defined(OS_ANDROID) || defined(OS_LINUX) | 92 #if defined(OS_ANDROID) || defined(OS_LINUX) |
| 93 SetPriority(base::ThreadPriority::BACKGROUND); | 93 SetPriority(base::ThreadPriority::BACKGROUND); |
| 94 #endif | 94 #endif |
| 95 } | 95 } |
| 96 ~TransferThread() override { Stop(); } | 96 ~TransferThread() override { Stop(); } |
| 97 | 97 |
| 98 void Init() override { | 98 void Init() override { |
| 99 gfx::GLShareGroup* share_group = NULL; | 99 gfx::GLShareGroup* share_group = NULL; |
| 100 surface_ = new gfx::PbufferGLSurfaceEGL(gfx::Size(1, 1)); | 100 surface_ = new gfx::PbufferGLSurfaceEGL(gfx::Size(1, 1), |
| 101 gfx::SurfaceConfiguration()); |
| 101 surface_->Initialize(); | 102 surface_->Initialize(); |
| 102 context_ = gfx::GLContext::CreateGLContext( | 103 context_ = gfx::GLContext::CreateGLContext( |
| 103 share_group, surface_.get(), gfx::PreferDiscreteGpu); | 104 share_group, surface_.get(), gfx::PreferDiscreteGpu); |
| 104 bool is_current = context_->MakeCurrent(surface_.get()); | 105 bool is_current = context_->MakeCurrent(surface_.get()); |
| 105 DCHECK(is_current); | 106 DCHECK(is_current); |
| 106 } | 107 } |
| 107 | 108 |
| 108 void CleanUp() override { | 109 void CleanUp() override { |
| 109 surface_ = NULL; | 110 surface_ = NULL; |
| 110 context_->ReleaseCurrent(surface_.get()); | 111 context_->ReleaseCurrent(surface_.get()); |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 | 738 |
| 738 AsyncPixelTransferDelegate* | 739 AsyncPixelTransferDelegate* |
| 739 AsyncPixelTransferManagerEGL::CreatePixelTransferDelegateImpl( | 740 AsyncPixelTransferManagerEGL::CreatePixelTransferDelegateImpl( |
| 740 gles2::TextureRef* ref, | 741 gles2::TextureRef* ref, |
| 741 const AsyncTexImage2DParams& define_params) { | 742 const AsyncTexImage2DParams& define_params) { |
| 742 return new AsyncPixelTransferDelegateEGL( | 743 return new AsyncPixelTransferDelegateEGL( |
| 743 &shared_state_, ref->service_id(), define_params); | 744 &shared_state_, ref->service_id(), define_params); |
| 744 } | 745 } |
| 745 | 746 |
| 746 } // namespace gpu | 747 } // namespace gpu |
| OLD | NEW |