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

Unified Diff: media/renderers/mock_gpu_video_accelerator_factories.cc

Issue 2006893002: Video Gmb Pool: Plumb GpuMemoryBufferId through to compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add gmb ID support to unittests 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 | « media/base/video_frame.cc ('k') | media/video/gpu_memory_buffer_video_frame_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/renderers/mock_gpu_video_accelerator_factories.cc
diff --git a/media/renderers/mock_gpu_video_accelerator_factories.cc b/media/renderers/mock_gpu_video_accelerator_factories.cc
index 16fc9010ab0029ba01284a7e489a09ced48b8fd2..d70338071bb5d9d6211274567ee6168e489b0f30 100644
--- a/media/renderers/mock_gpu_video_accelerator_factories.cc
+++ b/media/renderers/mock_gpu_video_accelerator_factories.cc
@@ -13,6 +13,7 @@ namespace media {
namespace {
bool gpu_memory_buffers_in_use_by_window_server = false;
+int g_next_gpu_memory_buffer_id = 1;
class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
public:
@@ -20,7 +21,8 @@ class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
: mapped_(false),
format_(format),
size_(size),
- num_planes_(gfx::NumberOfPlanesForBufferFormat(format)) {
+ num_planes_(gfx::NumberOfPlanesForBufferFormat(format)),
+ id_(g_next_gpu_memory_buffer_id++) {
DCHECK(gfx::BufferFormat::R_8 == format_ ||
gfx::BufferFormat::YUV_420_BIPLANAR == format_ ||
gfx::BufferFormat::UYVY_422 == format_);
@@ -59,10 +61,7 @@ class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
return static_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 {
NOTREACHED();
return gfx::GpuMemoryBufferHandle();
@@ -79,6 +78,7 @@ class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
const gfx::Size size_;
size_t num_planes_;
std::vector<uint8_t> bytes_[kMaxPlanes];
+ gfx::GpuMemoryBufferId id_;
};
} // unnamed namespace
« no previous file with comments | « media/base/video_frame.cc ('k') | media/video/gpu_memory_buffer_video_frame_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698