| 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 "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "gpu/GLES2/gl2extchromium.h" | 8 #include "gpu/GLES2/gl2extchromium.h" |
| 9 #include "gpu/command_buffer/client/gl_in_process_context.h" | 9 #include "gpu/command_buffer/client/gl_in_process_context.h" |
| 10 #include "gpu/command_buffer/client/gles2_implementation.h" | 10 #include "gpu/command_buffer/client/gles2_implementation.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 skia::AdoptRef(skia_bindings::CreateCommandBufferSkiaGLBinding()); | 117 skia::AdoptRef(skia_bindings::CreateCommandBufferSkiaGLBinding()); |
| 118 interface->fCallback = BindGrContextCallback; | 118 interface->fCallback = BindGrContextCallback; |
| 119 interface->fCallbackData = reinterpret_cast<GrGLInterfaceCallbackData>(this); | 119 interface->fCallbackData = reinterpret_cast<GrGLInterfaceCallbackData>(this); |
| 120 | 120 |
| 121 gr_context_ = skia::AdoptRef(GrContext::Create( | 121 gr_context_ = skia::AdoptRef(GrContext::Create( |
| 122 kOpenGL_GrBackend, reinterpret_cast<GrBackendContext>(interface.get()))); | 122 kOpenGL_GrBackend, reinterpret_cast<GrBackendContext>(interface.get()))); |
| 123 | 123 |
| 124 return gr_context_.get(); | 124 return gr_context_.get(); |
| 125 } | 125 } |
| 126 | 126 |
| 127 void TestInProcessContextProvider::InvalidateGrContext(uint32_t state) { |
| 128 if (gr_context_) |
| 129 gr_context_.get()->resetContext(state); |
| 130 } |
| 131 |
| 127 void TestInProcessContextProvider::SetupLock() { | 132 void TestInProcessContextProvider::SetupLock() { |
| 128 } | 133 } |
| 129 | 134 |
| 130 base::Lock* TestInProcessContextProvider::GetLock() { | 135 base::Lock* TestInProcessContextProvider::GetLock() { |
| 131 return &context_lock_; | 136 return &context_lock_; |
| 132 } | 137 } |
| 133 | 138 |
| 134 ContextProvider::Capabilities | 139 ContextProvider::Capabilities |
| 135 TestInProcessContextProvider::ContextCapabilities() { | 140 TestInProcessContextProvider::ContextCapabilities() { |
| 136 ContextProvider::Capabilities capabilities; | 141 ContextProvider::Capabilities capabilities; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 151 | 156 |
| 152 bool TestInProcessContextProvider::DestroyedOnMainThread() { return false; } | 157 bool TestInProcessContextProvider::DestroyedOnMainThread() { return false; } |
| 153 | 158 |
| 154 void TestInProcessContextProvider::SetLostContextCallback( | 159 void TestInProcessContextProvider::SetLostContextCallback( |
| 155 const LostContextCallback& lost_context_callback) {} | 160 const LostContextCallback& lost_context_callback) {} |
| 156 | 161 |
| 157 void TestInProcessContextProvider::SetMemoryPolicyChangedCallback( | 162 void TestInProcessContextProvider::SetMemoryPolicyChangedCallback( |
| 158 const MemoryPolicyChangedCallback& memory_policy_changed_callback) {} | 163 const MemoryPolicyChangedCallback& memory_policy_changed_callback) {} |
| 159 | 164 |
| 160 } // namespace cc | 165 } // namespace cc |
| OLD | NEW |