| 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 #include "gpu/command_buffer/tests/gl_manager.h" | 5 #include "gpu/command_buffer/tests/gl_manager.h" |
| 6 | 6 |
| 7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
| 8 #include <GLES2/gl2ext.h> | 8 #include <GLES2/gl2ext.h> |
| 9 #include <GLES2/gl2extchromium.h> | 9 #include <GLES2/gl2extchromium.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 } | 575 } |
| 576 | 576 |
| 577 static int32_t next_id = 1; | 577 static int32_t next_id = 1; |
| 578 int32_t new_id = next_id++; | 578 int32_t new_id = next_id++; |
| 579 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); | 579 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); |
| 580 DCHECK(image_manager); | 580 DCHECK(image_manager); |
| 581 image_manager->AddImage(gl_image.get(), new_id); | 581 image_manager->AddImage(gl_image.get(), new_id); |
| 582 return new_id; | 582 return new_id; |
| 583 } | 583 } |
| 584 | 584 |
| 585 int32_t GLManager::CreateGpuMemoryBufferImage(size_t width, | |
| 586 size_t height, | |
| 587 unsigned internalformat, | |
| 588 unsigned usage) { | |
| 589 DCHECK_EQ(usage, static_cast<unsigned>(GL_READ_WRITE_CHROMIUM)); | |
| 590 std::unique_ptr<gfx::GpuMemoryBuffer> buffer = CreateGpuMemoryBuffer( | |
| 591 gfx::Size(width, height), gfx::BufferFormat::RGBA_8888); | |
| 592 return CreateImage(buffer->AsClientBuffer(), width, height, internalformat); | |
| 593 } | |
| 594 | |
| 595 void GLManager::DestroyImage(int32_t id) { | 585 void GLManager::DestroyImage(int32_t id) { |
| 596 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); | 586 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); |
| 597 DCHECK(image_manager); | 587 DCHECK(image_manager); |
| 598 image_manager->RemoveImage(id); | 588 image_manager->RemoveImage(id); |
| 599 } | 589 } |
| 600 | 590 |
| 601 void GLManager::SignalQuery(uint32_t query, const base::Closure& callback) { | 591 void GLManager::SignalQuery(uint32_t query, const base::Closure& callback) { |
| 602 NOTIMPLEMENTED(); | 592 NOTIMPLEMENTED(); |
| 603 } | 593 } |
| 604 | 594 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 | 648 |
| 659 // Something went wrong, just run the callback now. | 649 // Something went wrong, just run the callback now. |
| 660 callback.Run(); | 650 callback.Run(); |
| 661 } | 651 } |
| 662 | 652 |
| 663 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { | 653 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { |
| 664 return false; | 654 return false; |
| 665 } | 655 } |
| 666 | 656 |
| 667 } // namespace gpu | 657 } // namespace gpu |
| OLD | NEW |