Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4463)

Unified Diff: cc/test/test_gpu_memory_buffer_manager.cc

Issue 1957583002: cc: Add GpuMemoryBufferId to TextureMailbox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unsigned -> signed Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/video_resource_updater.cc ('k') | components/exo/buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/test_gpu_memory_buffer_manager.cc
diff --git a/cc/test/test_gpu_memory_buffer_manager.cc b/cc/test/test_gpu_memory_buffer_manager.cc
index c2334da6686076e7f88ad3d3797b79eef324591c..8da2d2db6283f9beefaccbc3a93a2a92a07935be 100644
--- a/cc/test/test_gpu_memory_buffer_manager.cc
+++ b/cc/test/test_gpu_memory_buffer_manager.cc
@@ -16,6 +16,8 @@
namespace cc {
namespace {
+int g_gpu_memory_buffer_id_counter = 0;
+
class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
public:
GpuMemoryBufferImpl(const gfx::Size& size,
@@ -23,7 +25,8 @@ class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
std::unique_ptr<base::SharedMemory> shared_memory,
size_t offset,
size_t stride)
- : size_(size),
+ : id_(++g_gpu_memory_buffer_id_counter),
+ size_(size),
format_(format),
shared_memory_(std::move(shared_memory)),
offset_(offset),
@@ -62,10 +65,7 @@ class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
return base::checked_cast<int>(gfx::RowSizeForBufferFormat(
size_.width(), format_, static_cast<int>(plane)));
}
- gfx::GpuMemoryBufferId GetId() const override {
- NOTREACHED();
- return gfx::GpuMemoryBufferId(0);
- }
+ gfx::GpuMemoryBufferId GetId() const override { return id_; }
gfx::GpuMemoryBufferHandle GetHandle() const override {
gfx::GpuMemoryBufferHandle handle;
handle.type = gfx::SHARED_MEMORY_BUFFER;
@@ -83,6 +83,7 @@ class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
}
private:
+ gfx::GpuMemoryBufferId id_;
const gfx::Size size_;
gfx::BufferFormat format_;
std::unique_ptr<base::SharedMemory> shared_memory_;
« no previous file with comments | « cc/resources/video_resource_updater.cc ('k') | components/exo/buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698