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_share_group.h" | 5 #include "gpu/command_buffer/service/async_pixel_transfer_manager_share_group.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 void InitializeOnTransferThread(gfx::GLContext* parent_context, | 92 void InitializeOnTransferThread(gfx::GLContext* parent_context, |
93 base::WaitableEvent* caller_wait) { | 93 base::WaitableEvent* caller_wait) { |
94 TRACE_EVENT0("gpu", "InitializeOnTransferThread"); | 94 TRACE_EVENT0("gpu", "InitializeOnTransferThread"); |
95 | 95 |
96 if (!parent_context) { | 96 if (!parent_context) { |
97 LOG(ERROR) << "No parent context provided."; | 97 LOG(ERROR) << "No parent context provided."; |
98 caller_wait->Signal(); | 98 caller_wait->Signal(); |
99 return; | 99 return; |
100 } | 100 } |
101 | 101 |
102 surface_ = gfx::GLSurface::CreateOffscreenGLSurface(false, gfx::Size(1, 1)); | 102 surface_ = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)); |
103 if (!surface_.get()) { | 103 if (!surface_.get()) { |
104 LOG(ERROR) << "Unable to create GLSurface"; | 104 LOG(ERROR) << "Unable to create GLSurface"; |
105 caller_wait->Signal(); | 105 caller_wait->Signal(); |
106 return; | 106 return; |
107 } | 107 } |
108 | 108 |
109 // TODO(backer): This is coded for integrated GPUs. For discrete GPUs | 109 // TODO(backer): This is coded for integrated GPUs. For discrete GPUs |
110 // we would probably want to use a PBO texture upload for a true async | 110 // we would probably want to use a PBO texture upload for a true async |
111 // upload (that would hopefully be optimized as a DMA transfer by the | 111 // upload (that would hopefully be optimized as a DMA transfer by the |
112 // driver). | 112 // driver). |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 | 515 |
516 AsyncPixelTransferDelegate* | 516 AsyncPixelTransferDelegate* |
517 AsyncPixelTransferManagerShareGroup::CreatePixelTransferDelegateImpl( | 517 AsyncPixelTransferManagerShareGroup::CreatePixelTransferDelegateImpl( |
518 gles2::TextureRef* ref, | 518 gles2::TextureRef* ref, |
519 const AsyncTexImage2DParams& define_params) { | 519 const AsyncTexImage2DParams& define_params) { |
520 return new AsyncPixelTransferDelegateShareGroup( | 520 return new AsyncPixelTransferDelegateShareGroup( |
521 &shared_state_, ref->service_id(), define_params); | 521 &shared_state_, ref->service_id(), define_params); |
522 } | 522 } |
523 | 523 |
524 } // namespace gpu | 524 } // namespace gpu |
OLD | NEW |