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 "cc/test/test_in_process_context_provider.h" | 5 #include "cc/test/test_in_process_context_provider.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 } | 80 } |
81 | 81 |
82 gpu::ContextSupport* TestInProcessContextProvider::ContextSupport() { | 82 gpu::ContextSupport* TestInProcessContextProvider::ContextSupport() { |
83 return context_->GetImplementation(); | 83 return context_->GetImplementation(); |
84 } | 84 } |
85 | 85 |
86 class GrContext* TestInProcessContextProvider::GrContext() { | 86 class GrContext* TestInProcessContextProvider::GrContext() { |
87 if (gr_context_) | 87 if (gr_context_) |
88 return gr_context_->get(); | 88 return gr_context_->get(); |
89 | 89 |
90 gr_context_.reset(new skia_bindings::GrContextForGLES2Interface(ContextGL())); | 90 gr_context_.reset(new skia_bindings::GrContextForGLES2Interface( |
| 91 ContextGL(), ContextCapabilities())); |
91 cache_controller_->SetGrContext(gr_context_->get()); | 92 cache_controller_->SetGrContext(gr_context_->get()); |
92 return gr_context_->get(); | 93 return gr_context_->get(); |
93 } | 94 } |
94 | 95 |
95 ContextCacheController* TestInProcessContextProvider::CacheController() { | 96 ContextCacheController* TestInProcessContextProvider::CacheController() { |
96 return cache_controller_.get(); | 97 return cache_controller_.get(); |
97 } | 98 } |
98 | 99 |
99 void TestInProcessContextProvider::InvalidateGrContext(uint32_t state) { | 100 void TestInProcessContextProvider::InvalidateGrContext(uint32_t state) { |
100 if (gr_context_) | 101 if (gr_context_) |
(...skipping 16 matching lines...) Expand all Loading... |
117 capabilities.texture_format_bgra8888 = true; | 118 capabilities.texture_format_bgra8888 = true; |
118 break; | 119 break; |
119 } | 120 } |
120 return capabilities; | 121 return capabilities; |
121 } | 122 } |
122 | 123 |
123 void TestInProcessContextProvider::SetLostContextCallback( | 124 void TestInProcessContextProvider::SetLostContextCallback( |
124 const LostContextCallback& lost_context_callback) {} | 125 const LostContextCallback& lost_context_callback) {} |
125 | 126 |
126 } // namespace cc | 127 } // namespace cc |
OLD | NEW |