| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // A class to emulate GLES2 over command buffers. | 5 // A class to emulate GLES2 over command buffers. |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 8 | 8 |
| 9 #include <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
| 10 #include <GLES2/gl2ext.h> | 10 #include <GLES2/gl2ext.h> |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 // Flush previously entered commands to ensure ordering with any | 333 // Flush previously entered commands to ensure ordering with any |
| 334 // glBeginQueryEXT() calls that may have been put into the context. | 334 // glBeginQueryEXT() calls that may have been put into the context. |
| 335 ShallowFlushCHROMIUM(); | 335 ShallowFlushCHROMIUM(); |
| 336 gpu_control_->SignalQuery( | 336 gpu_control_->SignalQuery( |
| 337 query, | 337 query, |
| 338 base::Bind(&GLES2Implementation::RunIfContextNotLost, | 338 base::Bind(&GLES2Implementation::RunIfContextNotLost, |
| 339 weak_ptr_factory_.GetWeakPtr(), | 339 weak_ptr_factory_.GetWeakPtr(), |
| 340 callback)); | 340 callback)); |
| 341 } | 341 } |
| 342 | 342 |
| 343 void GLES2Implementation::SetSurfaceVisible(bool visible) { | |
| 344 TRACE_EVENT1( | |
| 345 "gpu", "GLES2Implementation::SetSurfaceVisible", "visible", visible); | |
| 346 ShallowFlushCHROMIUM(); | |
| 347 gpu_control_->SetSurfaceVisible(visible); | |
| 348 } | |
| 349 | |
| 350 void GLES2Implementation::SetAggressivelyFreeResources( | 343 void GLES2Implementation::SetAggressivelyFreeResources( |
| 351 bool aggressively_free_resources) { | 344 bool aggressively_free_resources) { |
| 352 TRACE_EVENT1("gpu", "GLES2Implementation::SetAggressivelyFreeResources", | 345 TRACE_EVENT1("gpu", "GLES2Implementation::SetAggressivelyFreeResources", |
| 353 "aggressively_free_resources", aggressively_free_resources); | 346 "aggressively_free_resources", aggressively_free_resources); |
| 354 aggressively_free_resources_ = aggressively_free_resources; | 347 aggressively_free_resources_ = aggressively_free_resources; |
| 355 | 348 |
| 356 if (aggressively_free_resources_ && helper_->HaveRingBuffer()) { | 349 if (aggressively_free_resources_ && helper_->HaveRingBuffer()) { |
| 357 // Ensure that we clean up as much cache memory as possible and fully flush. | 350 // Ensure that we clean up as much cache memory as possible and fully flush. |
| 358 FlushDriverCachesCHROMIUM(); | 351 FlushDriverCachesCHROMIUM(); |
| 359 | 352 |
| (...skipping 6018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6378 CheckGLError(); | 6371 CheckGLError(); |
| 6379 } | 6372 } |
| 6380 | 6373 |
| 6381 // Include the auto-generated part of this file. We split this because it means | 6374 // Include the auto-generated part of this file. We split this because it means |
| 6382 // we can easily edit the non-auto generated parts right here in this file | 6375 // we can easily edit the non-auto generated parts right here in this file |
| 6383 // instead of having to edit some template or the code generator. | 6376 // instead of having to edit some template or the code generator. |
| 6384 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 6377 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 6385 | 6378 |
| 6386 } // namespace gles2 | 6379 } // namespace gles2 |
| 6387 } // namespace gpu | 6380 } // namespace gpu |
| OLD | NEW |