OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef SERVICES_UI_COMMON_GPU_MEMORY_BUFFER_IMPL_H_ | 5 #ifndef SERVICES_UI_PUBLIC_CPP_GPU_MEMORY_BUFFER_IMPL_H_ |
6 #define SERVICES_UI_COMMON_GPU_MEMORY_BUFFER_IMPL_H_ | 6 #define SERVICES_UI_PUBLIC_CPP_GPU_MEMORY_BUFFER_IMPL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "gpu/command_buffer/common/sync_token.h" | 12 #include "gpu/command_buffer/common/sync_token.h" |
13 #include "services/ui/common/mus_common_export.h" | |
14 #include "ui/gfx/geometry/size.h" | 13 #include "ui/gfx/geometry/size.h" |
15 #include "ui/gfx/gpu_memory_buffer.h" | 14 #include "ui/gfx/gpu_memory_buffer.h" |
16 | 15 |
17 #if defined(USE_OZONE) | 16 #if defined(USE_OZONE) |
18 #include "ui/ozone/public/native_pixmap.h" | 17 #include "ui/ozone/public/native_pixmap.h" |
19 #endif | 18 #endif |
20 | 19 |
21 namespace ui { | 20 namespace ui { |
22 | 21 |
23 // Provides common implementation of a GPU memory buffer. | 22 // Provides common implementation of a GPU memory buffer. |
24 class MUS_COMMON_EXPORT GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer { | 23 class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer { |
25 public: | 24 public: |
26 ~GpuMemoryBufferImpl() override; | 25 ~GpuMemoryBufferImpl() override; |
27 | 26 |
28 // Type-checking upcast routine. Returns an NULL on failure. | 27 // Type-checking upcast routine. Returns an NULL on failure. |
29 static GpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer); | 28 static GpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer); |
30 | 29 |
31 // Overridden from gfx::GpuMemoryBuffer: | 30 // Overridden from gfx::GpuMemoryBuffer: |
32 gfx::Size GetSize() const override; | 31 gfx::Size GetSize() const override; |
33 gfx::BufferFormat GetFormat() const override; | 32 gfx::BufferFormat GetFormat() const override; |
34 gfx::GpuMemoryBufferId GetId() const override; | 33 gfx::GpuMemoryBufferId GetId() const override; |
(...skipping 16 matching lines...) Expand all Loading... |
51 const gfx::Size size_; | 50 const gfx::Size size_; |
52 const gfx::BufferFormat format_; | 51 const gfx::BufferFormat format_; |
53 bool mapped_; | 52 bool mapped_; |
54 | 53 |
55 private: | 54 private: |
56 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImpl); | 55 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImpl); |
57 }; | 56 }; |
58 | 57 |
59 } // namespace ui | 58 } // namespace ui |
60 | 59 |
61 #endif // SERVICES_UI_COMMON_GPU_MEMORY_BUFFER_IMPL_H_ | 60 #endif // SERVICES_UI_PUBLIC_CPP_GPU_MEMORY_BUFFER_IMPL_H_ |
OLD | NEW |