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 "cc/resources/platform_color.h" | 8 #include "cc/resources/platform_color.h" |
9 #include "gpu/GLES2/gl2extchromium.h" | 9 #include "gpu/GLES2/gl2extchromium.h" |
10 #include "gpu/command_buffer/client/gl_in_process_context.h" | 10 #include "gpu/command_buffer/client/gl_in_process_context.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 135 |
136 base::Lock* TestInProcessContextProvider::GetLock() { | 136 base::Lock* TestInProcessContextProvider::GetLock() { |
137 return &context_lock_; | 137 return &context_lock_; |
138 } | 138 } |
139 | 139 |
140 ContextProvider::Capabilities | 140 ContextProvider::Capabilities |
141 TestInProcessContextProvider::ContextCapabilities() { | 141 TestInProcessContextProvider::ContextCapabilities() { |
142 ContextProvider::Capabilities capabilities; | 142 ContextProvider::Capabilities capabilities; |
143 capabilities.gpu.image = true; | 143 capabilities.gpu.image = true; |
144 capabilities.gpu.texture_rectangle = true; | 144 capabilities.gpu.texture_rectangle = true; |
145 capabilities.gpu.sync_query = true; | |
146 | 145 |
147 switch (PlatformColor::Format()) { | 146 switch (PlatformColor::Format()) { |
148 case PlatformColor::SOURCE_FORMAT_RGBA8: | 147 case PlatformColor::SOURCE_FORMAT_RGBA8: |
149 capabilities.gpu.texture_format_bgra8888 = false; | 148 capabilities.gpu.texture_format_bgra8888 = false; |
150 break; | 149 break; |
151 case PlatformColor::SOURCE_FORMAT_BGRA8: | 150 case PlatformColor::SOURCE_FORMAT_BGRA8: |
152 capabilities.gpu.texture_format_bgra8888 = true; | 151 capabilities.gpu.texture_format_bgra8888 = true; |
153 break; | 152 break; |
154 } | 153 } |
155 | 154 |
156 return capabilities; | 155 return capabilities; |
157 } | 156 } |
158 | 157 |
159 void TestInProcessContextProvider::VerifyContexts() {} | 158 void TestInProcessContextProvider::VerifyContexts() {} |
160 | 159 |
161 void TestInProcessContextProvider::DeleteCachedResources() { | 160 void TestInProcessContextProvider::DeleteCachedResources() { |
162 if (gr_context_) | 161 if (gr_context_) |
163 gr_context_->freeGpuResources(); | 162 gr_context_->freeGpuResources(); |
164 } | 163 } |
165 | 164 |
166 bool TestInProcessContextProvider::DestroyedOnMainThread() { return false; } | 165 bool TestInProcessContextProvider::DestroyedOnMainThread() { return false; } |
167 | 166 |
168 void TestInProcessContextProvider::SetLostContextCallback( | 167 void TestInProcessContextProvider::SetLostContextCallback( |
169 const LostContextCallback& lost_context_callback) {} | 168 const LostContextCallback& lost_context_callback) {} |
170 | 169 |
171 void TestInProcessContextProvider::SetMemoryPolicyChangedCallback( | 170 void TestInProcessContextProvider::SetMemoryPolicyChangedCallback( |
172 const MemoryPolicyChangedCallback& memory_policy_changed_callback) {} | 171 const MemoryPolicyChangedCallback& memory_policy_changed_callback) {} |
173 | 172 |
174 } // namespace cc | 173 } // namespace cc |
OLD | NEW |