| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ |
| 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/gfx/gpu_memory_buffer.h" | 10 #include "ui/gfx/gpu_memory_buffer.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 static bool IsFormatValid(unsigned internalformat); | 60 static bool IsFormatValid(unsigned internalformat); |
| 61 | 61 |
| 62 // Returns true if |usage| is recognized by this base class. | 62 // Returns true if |usage| is recognized by this base class. |
| 63 static bool IsUsageValid(unsigned usage); | 63 static bool IsUsageValid(unsigned usage); |
| 64 | 64 |
| 65 // Returns the number of bytes per pixel that must be used by an | 65 // Returns the number of bytes per pixel that must be used by an |
| 66 // implementation when using |internalformat|. | 66 // implementation when using |internalformat|. |
| 67 static size_t BytesPerPixel(unsigned internalformat); | 67 static size_t BytesPerPixel(unsigned internalformat); |
| 68 | 68 |
| 69 // Overridden from gfx::GpuMemoryBuffer: | 69 // Overridden from gfx::GpuMemoryBuffer: |
| 70 virtual bool IsMapped() const OVERRIDE; | 70 virtual bool IsMapped() const override; |
| 71 | 71 |
| 72 protected: | 72 protected: |
| 73 GpuMemoryBufferImpl(const gfx::Size& size, | 73 GpuMemoryBufferImpl(const gfx::Size& size, |
| 74 unsigned internalformat, | 74 unsigned internalformat, |
| 75 const DestructionCallback& callback); | 75 const DestructionCallback& callback); |
| 76 | 76 |
| 77 const gfx::Size size_; | 77 const gfx::Size size_; |
| 78 const unsigned internalformat_; | 78 const unsigned internalformat_; |
| 79 const DestructionCallback callback_; | 79 const DestructionCallback callback_; |
| 80 bool mapped_; | 80 bool mapped_; |
| 81 | 81 |
| 82 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImpl); | 82 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImpl); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace content | 85 } // namespace content |
| 86 | 86 |
| 87 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ | 87 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ |
| OLD | NEW |