Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: blimp/client/feature/compositor/blimp_context_provider.cc

Issue 1900993002: Move SharedMemoryLimits out of WebGraphicsContext3DCommandBufferImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@limits
Patch Set: move-limits: types Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « blimp/client/feature/compositor/blimp_context_provider.h ('k') | cc/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 base::Bind(&BlimpContextProvider::OnLostContext, base::Unretained(this))); 49 base::Bind(&BlimpContextProvider::OnLostContext, base::Unretained(this)));
50 } 50 }
51 51
52 BlimpContextProvider::~BlimpContextProvider() { 52 BlimpContextProvider::~BlimpContextProvider() {
53 DCHECK(main_thread_checker_.CalledOnValidThread() || 53 DCHECK(main_thread_checker_.CalledOnValidThread() ||
54 context_thread_checker_.CalledOnValidThread()); 54 context_thread_checker_.CalledOnValidThread());
55 } 55 }
56 56
57 bool BlimpContextProvider::BindToCurrentThread() { 57 bool BlimpContextProvider::BindToCurrentThread() {
58 DCHECK(context_thread_checker_.CalledOnValidThread()); 58 DCHECK(context_thread_checker_.CalledOnValidThread());
59 capabilities_.gpu = context_->GetImplementation()->capabilities();
60 capabilities_.gpu.image = true;
61 return true; 59 return true;
62 } 60 }
63 61
64 void BlimpContextProvider::DetachFromThread() { 62 void BlimpContextProvider::DetachFromThread() {
65 context_thread_checker_.DetachFromThread(); 63 context_thread_checker_.DetachFromThread();
66 } 64 }
67 65
68 cc::ContextProvider::Capabilities BlimpContextProvider::ContextCapabilities() { 66 gpu::Capabilities BlimpContextProvider::ContextCapabilities() {
69 DCHECK(context_thread_checker_.CalledOnValidThread()); 67 DCHECK(context_thread_checker_.CalledOnValidThread());
70 return capabilities_; 68 gpu::Capabilities 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;
71 } 74 }
72 75
73 gpu::gles2::GLES2Interface* BlimpContextProvider::ContextGL() { 76 gpu::gles2::GLES2Interface* BlimpContextProvider::ContextGL() {
74 DCHECK(context_thread_checker_.CalledOnValidThread()); 77 DCHECK(context_thread_checker_.CalledOnValidThread());
75 return context_->GetImplementation(); 78 return context_->GetImplementation();
76 } 79 }
77 80
78 gpu::ContextSupport* BlimpContextProvider::ContextSupport() { 81 gpu::ContextSupport* BlimpContextProvider::ContextSupport() {
79 DCHECK(context_thread_checker_.CalledOnValidThread()); 82 DCHECK(context_thread_checker_.CalledOnValidThread());
80 return context_->GetImplementation(); 83 return context_->GetImplementation();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 void BlimpContextProvider::OnLostContext() { 125 void BlimpContextProvider::OnLostContext() {
123 DCHECK(context_thread_checker_.CalledOnValidThread()); 126 DCHECK(context_thread_checker_.CalledOnValidThread());
124 if (!lost_context_callback_.is_null()) 127 if (!lost_context_callback_.is_null())
125 lost_context_callback_.Run(); 128 lost_context_callback_.Run();
126 if (gr_context_) 129 if (gr_context_)
127 gr_context_->OnLostContext(); 130 gr_context_->OnLostContext();
128 } 131 }
129 132
130 } // namespace client 133 } // namespace client
131 } // namespace blimp 134 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/client/feature/compositor/blimp_context_provider.h ('k') | cc/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698