| 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 "components/view_manager/gles2/command_buffer_driver.h" | 5 #include "components/view_manager/gles2/command_buffer_driver.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
| 10 #include "components/view_manager/gles2/command_buffer_type_conversions.h" | 10 #include "components/view_manager/gles2/command_buffer_type_conversions.h" |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 } | 249 } |
| 250 | 250 |
| 251 if (type != gfx::SHARED_MEMORY_BUFFER) { | 251 if (type != gfx::SHARED_MEMORY_BUFFER) { |
| 252 NOTIMPLEMENTED(); | 252 NOTIMPLEMENTED(); |
| 253 return; | 253 return; |
| 254 } | 254 } |
| 255 | 255 |
| 256 gfx::GpuMemoryBufferHandle gfx_handle; | 256 gfx::GpuMemoryBufferHandle gfx_handle; |
| 257 // TODO(jam): create mojo enum for this and converter | 257 // TODO(jam): create mojo enum for this and converter |
| 258 gfx_handle.type = static_cast<gfx::GpuMemoryBufferType>(type); | 258 gfx_handle.type = static_cast<gfx::GpuMemoryBufferType>(type); |
| 259 gfx_handle.id = id; | 259 gfx_handle.id = gfx::GpuMemoryBufferId(id); |
| 260 | 260 |
| 261 MojoPlatformHandle platform_handle; | 261 MojoPlatformHandle platform_handle; |
| 262 MojoResult extract_result = MojoExtractPlatformHandle( | 262 MojoResult extract_result = MojoExtractPlatformHandle( |
| 263 memory_handle.release().value(), | 263 memory_handle.release().value(), |
| 264 &platform_handle); | 264 &platform_handle); |
| 265 if (extract_result != MOJO_RESULT_OK) { | 265 if (extract_result != MOJO_RESULT_OK) { |
| 266 NOTREACHED(); | 266 NOTREACHED(); |
| 267 return; | 267 return; |
| 268 } | 268 } |
| 269 | 269 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 | 333 |
| 334 void CommandBufferDriver::DestroyDecoder() { | 334 void CommandBufferDriver::DestroyDecoder() { |
| 335 if (decoder_) { | 335 if (decoder_) { |
| 336 bool have_context = decoder_->MakeCurrent(); | 336 bool have_context = decoder_->MakeCurrent(); |
| 337 decoder_->Destroy(have_context); | 337 decoder_->Destroy(have_context); |
| 338 decoder_.reset(); | 338 decoder_.reset(); |
| 339 } | 339 } |
| 340 } | 340 } |
| 341 | 341 |
| 342 } // namespace gles2 | 342 } // namespace gles2 |
| OLD | NEW |