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

Side by Side Diff: ui/gl/gl_image.h

Issue 2388653002: gpu: Add CHROMIUM_texture_from_image spec and fence support.
Patch Set: rebase Created 4 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp ('k') | ui/gl/gl_image_egl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_GL_GL_IMAGE_H_ 5 #ifndef UI_GL_GL_IMAGE_H_
6 #define UI_GL_GL_IMAGE_H_ 6 #define UI_GL_GL_IMAGE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "ui/gfx/geometry/point.h" 14 #include "ui/gfx/geometry/point.h"
15 #include "ui/gfx/geometry/rect.h" 15 #include "ui/gfx/geometry/rect.h"
16 #include "ui/gfx/geometry/rect_f.h" 16 #include "ui/gfx/geometry/rect_f.h"
17 #include "ui/gfx/geometry/size.h" 17 #include "ui/gfx/geometry/size.h"
18 #include "ui/gfx/native_widget_types.h" 18 #include "ui/gfx/native_widget_types.h"
19 #include "ui/gfx/overlay_transform.h" 19 #include "ui/gfx/overlay_transform.h"
20 #include "ui/gl/gl_export.h" 20 #include "ui/gl/gl_export.h"
21 21
22 namespace base { 22 namespace base {
23 namespace trace_event { 23 namespace trace_event {
24 class ProcessMemoryDump; 24 class ProcessMemoryDump;
25 } 25 }
26 } 26 }
27 27
28 namespace gl { 28 namespace gl {
29 class GLFence;
29 30
30 // Encapsulates an image that can be bound and/or copied to a texture, hiding 31 // Encapsulates an image that can be bound and/or copied to a texture, hiding
31 // platform specific management. 32 // platform specific management.
32 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { 33 class GL_EXPORT GLImage : public base::RefCounted<GLImage> {
33 public: 34 public:
34 GLImage() {} 35 GLImage() {}
35 36
36 // Destroys the image. 37 // Destroys the image.
37 virtual void Destroy(bool have_context) = 0; 38 virtual void Destroy(bool have_context) = 0;
38 39
39 // Get the size of the image. 40 // Get the size of the image.
40 virtual gfx::Size GetSize() = 0; 41 virtual gfx::Size GetSize() = 0;
41 42
42 // Get the internal format of the image. 43 // Get the internal format of the image.
43 virtual unsigned GetInternalFormat() = 0; 44 virtual unsigned GetInternalFormat() = 0;
44 45
45 // Bind image to texture currently bound to |target|. Returns true on success. 46 // Bind image to texture currently bound to |target|. Returns true on success.
46 // It is valid for an implementation to always return false. 47 // It is valid for an implementation to always return false.
47 virtual bool BindTexImage(unsigned target) = 0; 48 virtual bool BindTexImage(unsigned target, GLFence* fence) = 0;
fooishbar 2016/10/11 11:33:32 media/gpu/vaapi_drm_picture.cc needs an update her
reveman 2016/10/11 15:04:48 Done
48 49
49 // Release image from texture currently bound to |target|. 50 // Release image from texture currently bound to |target|.
50 virtual void ReleaseTexImage(unsigned target) = 0; 51 virtual void ReleaseTexImage(unsigned target) = 0;
51 52
52 // Define texture currently bound to |target| by copying image into it. 53 // Define texture currently bound to |target| by copying image into it.
53 // Returns true on success. It is valid for an implementation to always 54 // Returns true on success. It is valid for an implementation to always
54 // return false. 55 // return false.
55 virtual bool CopyTexImage(unsigned target) = 0; 56 virtual bool CopyTexImage(unsigned target) = 0;
56 57
57 // Copy |rect| of image to |offset| in texture currently bound to |target|. 58 // Copy |rect| of image to |offset| in texture currently bound to |target|.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 101
101 private: 102 private:
102 friend class base::RefCounted<GLImage>; 103 friend class base::RefCounted<GLImage>;
103 104
104 DISALLOW_COPY_AND_ASSIGN(GLImage); 105 DISALLOW_COPY_AND_ASSIGN(GLImage);
105 }; 106 };
106 107
107 } // namespace gl 108 } // namespace gl
108 109
109 #endif // UI_GL_GL_IMAGE_H_ 110 #endif // UI_GL_GL_IMAGE_H_
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp ('k') | ui/gl/gl_image_egl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698