Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/compositor/test/in_process_context_provider.h" | 5 #include "ui/compositor/test/in_process_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 "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 // This is called on the thread the context will be used. | 83 // This is called on the thread the context will be used. |
| 84 DCHECK(context_thread_checker_.CalledOnValidThread()); | 84 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 85 | 85 |
| 86 if (!context_) { | 86 if (!context_) { |
| 87 context_.reset(gpu::GLInProcessContext::Create( | 87 context_.reset(gpu::GLInProcessContext::Create( |
| 88 nullptr, /* service */ | 88 nullptr, /* service */ |
| 89 nullptr, /* surface */ | 89 nullptr, /* surface */ |
| 90 !window_, /* is_offscreen */ | 90 !window_, /* is_offscreen */ |
| 91 window_, (shared_context_ ? shared_context_->context_.get() : nullptr), | 91 window_, (shared_context_ ? shared_context_->context_.get() : nullptr), |
| 92 attribs_, gpu::SharedMemoryLimits(), gpu_memory_buffer_manager_, | 92 attribs_, gpu::SharedMemoryLimits(), gpu_memory_buffer_manager_, |
| 93 image_factory_)); | 93 image_factory_, nullptr /* task_runner */)); |
|
danakj
2016/09/19 18:59:17
I think you should pass non-null cuz otherwise if
ericrk
2016/09/19 20:00:27
Yeah - fair enough - I was thinking this was fine
| |
| 94 | 94 |
| 95 if (!context_) | 95 if (!context_) |
| 96 return false; | 96 return false; |
| 97 | 97 |
| 98 cache_controller_.reset( | 98 cache_controller_.reset(new cc::ContextCacheController( |
| 99 new cc::ContextCacheController(context_->GetImplementation())); | 99 context_->GetImplementation(), nullptr /* task_runner */)); |
| 100 } | 100 } |
| 101 | 101 |
| 102 std::string unique_context_name = | 102 std::string unique_context_name = |
| 103 base::StringPrintf("%s-%p", debug_name_.c_str(), context_.get()); | 103 base::StringPrintf("%s-%p", debug_name_.c_str(), context_.get()); |
| 104 context_->GetImplementation()->TraceBeginCHROMIUM( | 104 context_->GetImplementation()->TraceBeginCHROMIUM( |
| 105 "gpu_toplevel", unique_context_name.c_str()); | 105 "gpu_toplevel", unique_context_name.c_str()); |
| 106 | 106 |
| 107 return true; | 107 return true; |
| 108 } | 108 } |
| 109 | 109 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 uint32_t InProcessContextProvider::GetCopyTextureInternalFormat() { | 164 uint32_t InProcessContextProvider::GetCopyTextureInternalFormat() { |
| 165 if (attribs_.alpha_size > 0) | 165 if (attribs_.alpha_size > 0) |
| 166 return GL_RGBA; | 166 return GL_RGBA; |
| 167 DCHECK_NE(attribs_.red_size, 0); | 167 DCHECK_NE(attribs_.red_size, 0); |
| 168 DCHECK_NE(attribs_.green_size, 0); | 168 DCHECK_NE(attribs_.green_size, 0); |
| 169 DCHECK_NE(attribs_.blue_size, 0); | 169 DCHECK_NE(attribs_.blue_size, 0); |
| 170 return GL_RGB; | 170 return GL_RGB; |
| 171 } | 171 } |
| 172 | 172 |
| 173 } // namespace ui | 173 } // namespace ui |
| OLD | NEW |