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

Side by Side Diff: content/common/gpu/client/gpu_memory_buffer_impl.h

Issue 1024113003: Add multi-planar functions to GpuMemoryBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
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 "content/common/content_export.h" 10 #include "content/common/content_export.h"
(...skipping 23 matching lines...) Expand all
34 static GpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer); 34 static GpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer);
35 35
36 // Calculates the number of bytes that an implementation must use to store 36 // Calculates the number of bytes that an implementation must use to store
37 // one row of pixel data. 37 // one row of pixel data.
38 static bool StrideInBytes(size_t width, 38 static bool StrideInBytes(size_t width,
39 Format format, 39 Format format,
40 size_t* stride_in_bytes); 40 size_t* stride_in_bytes);
41 41
42 // Overridden from gfx::GpuMemoryBuffer: 42 // Overridden from gfx::GpuMemoryBuffer:
43 bool IsMapped() const override; 43 bool IsMapped() const override;
44 size_t GetNumberOfPlanes() const override;
44 Format GetFormat() const override; 45 Format GetFormat() const override;
45 ClientBuffer AsClientBuffer() override; 46 ClientBuffer AsClientBuffer() override;
46 47
47 void set_destruction_sync_point(uint32 sync_point) { 48 void set_destruction_sync_point(uint32 sync_point) {
48 destruction_sync_point_ = sync_point; 49 destruction_sync_point_ = sync_point;
49 } 50 }
50 51
51 protected: 52 protected:
52 GpuMemoryBufferImpl(gfx::GpuMemoryBufferId id, 53 GpuMemoryBufferImpl(gfx::GpuMemoryBufferId id,
53 const gfx::Size& size, 54 const gfx::Size& size,
54 Format format, 55 Format format,
55 const DestructionCallback& callback); 56 const DestructionCallback& callback);
56 57
57 const gfx::GpuMemoryBufferId id_; 58 const gfx::GpuMemoryBufferId id_;
58 const gfx::Size size_; 59 const gfx::Size size_;
59 const Format format_; 60 const Format format_;
61 const size_t num_planes_;
reveman 2015/03/21 03:03:55 This can be derived from the format. I don't think
emircan 2015/03/23 19:21:35 Acknowledged. I wanted to define this as const in
60 const DestructionCallback callback_; 62 const DestructionCallback callback_;
61 bool mapped_; 63 bool mapped_;
62 uint32 destruction_sync_point_; 64 uint32 destruction_sync_point_;
63 65
64 private: 66 private:
67
68 // Returns the number of planes based on the format of the buffer.
69 static size_t NumberOfPlanesForGpuMemoryBufferFormat(
70 gfx::GpuMemoryBuffer::Format format);
71
65 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImpl); 72 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImpl);
66 }; 73 };
67 74
68 } // namespace content 75 } // namespace content
69 76
70 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ 77 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698