OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "blimp/client/feature/compositor/blimp_context_provider.h" | 5 #include "blimp/client/feature/compositor/blimp_context_provider.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "gpu/command_buffer/client/gl_in_process_context.h" | 10 #include "gpu/command_buffer/client/gl_in_process_context.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 DCHECK(context_thread_checker_.CalledOnValidThread()); | 58 DCHECK(context_thread_checker_.CalledOnValidThread()); |
59 return true; | 59 return true; |
60 } | 60 } |
61 | 61 |
62 void BlimpContextProvider::DetachFromThread() { | 62 void BlimpContextProvider::DetachFromThread() { |
63 context_thread_checker_.DetachFromThread(); | 63 context_thread_checker_.DetachFromThread(); |
64 } | 64 } |
65 | 65 |
66 gpu::Capabilities BlimpContextProvider::ContextCapabilities() { | 66 gpu::Capabilities BlimpContextProvider::ContextCapabilities() { |
67 DCHECK(context_thread_checker_.CalledOnValidThread()); | 67 DCHECK(context_thread_checker_.CalledOnValidThread()); |
68 gpu::Capabilities capabilities = | 68 return context_->GetImplementation()->capabilities(); |
69 context_->GetImplementation()->capabilities(); | |
70 // TODO(danakj): Why? Is this even valid? This is the CHROMIUM_image extension | |
71 // to use GpuMemoryBuffers. Does the context not provide this? | |
72 capabilities.image = true; | |
73 return capabilities; | |
74 } | 69 } |
75 | 70 |
76 gpu::gles2::GLES2Interface* BlimpContextProvider::ContextGL() { | 71 gpu::gles2::GLES2Interface* BlimpContextProvider::ContextGL() { |
77 DCHECK(context_thread_checker_.CalledOnValidThread()); | 72 DCHECK(context_thread_checker_.CalledOnValidThread()); |
78 return context_->GetImplementation(); | 73 return context_->GetImplementation(); |
79 } | 74 } |
80 | 75 |
81 gpu::ContextSupport* BlimpContextProvider::ContextSupport() { | 76 gpu::ContextSupport* BlimpContextProvider::ContextSupport() { |
82 DCHECK(context_thread_checker_.CalledOnValidThread()); | 77 DCHECK(context_thread_checker_.CalledOnValidThread()); |
83 return context_->GetImplementation(); | 78 return context_->GetImplementation(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 void BlimpContextProvider::OnLostContext() { | 120 void BlimpContextProvider::OnLostContext() { |
126 DCHECK(context_thread_checker_.CalledOnValidThread()); | 121 DCHECK(context_thread_checker_.CalledOnValidThread()); |
127 if (!lost_context_callback_.is_null()) | 122 if (!lost_context_callback_.is_null()) |
128 lost_context_callback_.Run(); | 123 lost_context_callback_.Run(); |
129 if (gr_context_) | 124 if (gr_context_) |
130 gr_context_->OnLostContext(); | 125 gr_context_->OnLostContext(); |
131 } | 126 } |
132 | 127 |
133 } // namespace client | 128 } // namespace client |
134 } // namespace blimp | 129 } // namespace blimp |
OLD | NEW |