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

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

Issue 2930143004: Add DIRECT_COMPOSITION GpuMemoryBuffer type.
Patch Set: fix build Created 3 years, 6 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 (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 GLSurface;
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 // Get the size of the image. 37 // Get the size of the image.
37 virtual gfx::Size GetSize() = 0; 38 virtual gfx::Size GetSize() = 0;
38 39
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // GL_RGBA. The client is responsible for implementing appropriate 87 // GL_RGBA. The client is responsible for implementing appropriate
87 // workarounds. The only support that the command buffer provides is format 88 // workarounds. The only support that the command buffer provides is format
88 // validation during calls to copyTexImage2D and copySubTexImage2D. 89 // validation during calls to copyTexImage2D and copySubTexImage2D.
89 // 90 //
90 // This is a workaround that is not intended to become a permanent part of the 91 // This is a workaround that is not intended to become a permanent part of the
91 // GLImage API. Theoretically, when Apple fixes their drivers, this can be 92 // GLImage API. Theoretically, when Apple fixes their drivers, this can be
92 // removed. https://crbug.com/581777#c36 93 // removed. https://crbug.com/581777#c36
93 virtual bool EmulatingRGB() const; 94 virtual bool EmulatingRGB() const;
94 95
95 // An identifier for subclasses. Necessary for safe downcasting. 96 // An identifier for subclasses. Necessary for safe downcasting.
96 enum class Type { NONE, MEMORY, IOSURFACE, DXGI_IMAGE }; 97 enum class Type { NONE, MEMORY, IOSURFACE, DXGI_IMAGE, DIRECT_COMPOSITION };
reveman 2017/06/14 21:35:59 This type of downcasting is an indication that're
jbauman 2017/06/14 22:18:17 I guess I could have windows-only GetSwapChain() a
97 virtual Type GetType() const; 98 virtual Type GetType() const;
98 99
100 virtual scoped_refptr<GLSurface> GetSurface();
reveman 2017/06/14 21:35:59 How is this suppose to be used? Can we do somethin
jbauman 2017/06/14 22:18:17 This is actually going to be used to draw into the
101
99 protected: 102 protected:
100 virtual ~GLImage() {} 103 virtual ~GLImage() {}
101 104
102 private: 105 private:
103 friend class base::RefCounted<GLImage>; 106 friend class base::RefCounted<GLImage>;
104 107
105 DISALLOW_COPY_AND_ASSIGN(GLImage); 108 DISALLOW_COPY_AND_ASSIGN(GLImage);
106 }; 109 };
107 110
108 } // namespace gl 111 } // namespace gl
109 112
110 #endif // UI_GL_GL_IMAGE_H_ 113 #endif // UI_GL_GL_IMAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698