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

Side by Side Diff: content/common/gpu/gpu_memory_buffer_factory.h

Issue 634083002: gpu: Compositor management of GpuMemoryBuffer instances. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cc-pre-chromium-image-refactor
Patch Set: rebase Created 6 years, 2 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 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 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ 5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_
6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "ui/gfx/geometry/size.h" 10 #include "ui/gfx/geometry/size.h"
(...skipping 12 matching lines...) Expand all
23 23
24 // Creates a new platform specific factory instance. 24 // Creates a new platform specific factory instance.
25 static scoped_ptr<GpuMemoryBufferFactory> Create(); 25 static scoped_ptr<GpuMemoryBufferFactory> Create();
26 26
27 // Creates a GPU memory buffer instance from |handle|. Whether the storage for 27 // Creates a GPU memory buffer instance from |handle|. Whether the storage for
28 // the buffer is passed with the handle or allocated as part of buffer 28 // the buffer is passed with the handle or allocated as part of buffer
29 // creation depends on the type. A valid handle is returned on success. 29 // creation depends on the type. A valid handle is returned on success.
30 virtual gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( 30 virtual gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer(
31 const gfx::GpuMemoryBufferHandle& handle, 31 const gfx::GpuMemoryBufferHandle& handle,
32 const gfx::Size& size, 32 const gfx::Size& size,
33 unsigned internalformat, 33 gfx::GpuMemoryBuffer::Format format,
34 unsigned usage) = 0; 34 gfx::GpuMemoryBuffer::Usage usage) = 0;
35 35
36 // Destroys GPU memory buffer identified by |handle|. 36 // Destroys GPU memory buffer identified by |handle|.
37 virtual void DestroyGpuMemoryBuffer( 37 virtual void DestroyGpuMemoryBuffer(
38 const gfx::GpuMemoryBufferHandle& handle) = 0; 38 const gfx::GpuMemoryBufferHandle& handle) = 0;
39 39
40 // Creates a GLImage instance for GPU memory buffer identified by |handle|. 40 // Creates a GLImage instance for GPU memory buffer identified by |handle|.
41 // |client_id| should be set to the client requesting the creation of instance 41 // |client_id| should be set to the client requesting the creation of instance
42 // and can be used by factory implementation to verify access rights. 42 // and can be used by factory implementation to verify access rights.
43 virtual scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer( 43 virtual scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer(
44 const gfx::GpuMemoryBufferHandle& handle, 44 const gfx::GpuMemoryBufferHandle& handle,
45 const gfx::Size& size, 45 const gfx::Size& size,
46 gfx::GpuMemoryBuffer::Format format,
46 unsigned internalformat, 47 unsigned internalformat,
47 int client_id) = 0; 48 int client_id) = 0;
48 49
49 private: 50 private:
50 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactory); 51 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactory);
51 }; 52 };
52 53
53 } // namespace content 54 } // namespace content
54 55
55 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ 56 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.cc ('k') | content/common/gpu/gpu_memory_buffer_factory_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698