| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/common/gpu/gpu_memory_buffer_factory.h" | 5 #include "content/common/gpu/gpu_memory_buffer_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "gpu/command_buffer/service/image_factory.h" | 8 #include "gpu/command_buffer/service/image_factory.h" |
| 9 #include "ui/gl/gl_image.h" | 9 #include "ui/gl/gl_image.h" |
| 10 #include "ui/gl/gl_image_shared_memory.h" | 10 #include "ui/gl/gl_image_shared_memory.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 class GpuMemoryBufferFactoryImpl : public GpuMemoryBufferFactory, | 15 class GpuMemoryBufferFactoryImpl : public GpuMemoryBufferFactory, |
| 16 public gpu::ImageFactory { | 16 public gpu::ImageFactory { |
| 17 public: | 17 public: |
| 18 // Overridden from GpuMemoryBufferFactory: | 18 // Overridden from GpuMemoryBufferFactory: |
| 19 gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( | 19 gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( |
| 20 const gfx::GpuMemoryBufferHandle& handle, | 20 gfx::GpuMemoryBufferType type, |
| 21 gfx::GpuMemoryBufferId id, |
| 21 const gfx::Size& size, | 22 const gfx::Size& size, |
| 22 gfx::GpuMemoryBuffer::Format format, | 23 gfx::GpuMemoryBuffer::Format format, |
| 23 gfx::GpuMemoryBuffer::Usage usage) override { | 24 gfx::GpuMemoryBuffer::Usage usage, |
| 25 int client_id) override { |
| 24 NOTREACHED(); | 26 NOTREACHED(); |
| 25 return gfx::GpuMemoryBufferHandle(); | 27 return gfx::GpuMemoryBufferHandle(); |
| 26 } | 28 } |
| 27 void DestroyGpuMemoryBuffer( | 29 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferType type, |
| 28 const gfx::GpuMemoryBufferHandle& handle) override { | 30 gfx::GpuMemoryBufferId id, |
| 31 int client_id) override { |
| 29 NOTREACHED(); | 32 NOTREACHED(); |
| 30 } | 33 } |
| 31 gpu::ImageFactory* AsImageFactory() override { return this; } | 34 gpu::ImageFactory* AsImageFactory() override { return this; } |
| 32 | 35 |
| 33 // Overridden from gpu::ImageFactory: | 36 // Overridden from gpu::ImageFactory: |
| 34 scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer( | 37 scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer( |
| 35 const gfx::GpuMemoryBufferHandle& handle, | 38 const gfx::GpuMemoryBufferHandle& handle, |
| 36 const gfx::Size& size, | 39 const gfx::Size& size, |
| 37 gfx::GpuMemoryBuffer::Format format, | 40 gfx::GpuMemoryBuffer::Format format, |
| 38 unsigned internalformat, | 41 unsigned internalformat, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 55 | 58 |
| 56 } // namespace | 59 } // namespace |
| 57 | 60 |
| 58 // static | 61 // static |
| 59 scoped_ptr<GpuMemoryBufferFactory> GpuMemoryBufferFactory::Create() { | 62 scoped_ptr<GpuMemoryBufferFactory> GpuMemoryBufferFactory::Create() { |
| 60 return make_scoped_ptr<GpuMemoryBufferFactory>( | 63 return make_scoped_ptr<GpuMemoryBufferFactory>( |
| 61 new GpuMemoryBufferFactoryImpl); | 64 new GpuMemoryBufferFactoryImpl); |
| 62 } | 65 } |
| 63 | 66 |
| 64 } // namespace content | 67 } // namespace content |
| OLD | NEW |