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

Side by Side Diff: ui/ozone/public/surface_ozone_egl.h

Issue 2190353003: Delete old Ozone surface creation API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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 | « ui/ozone/public/surface_factory_ozone.cc ('k') | ui/ozone/public/surface_ozone_egl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_
6 #define UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_
7
8 #include <memory>
9
10 #include "base/callback.h"
11 #include "ui/gfx/overlay_transform.h"
12 #include "ui/gfx/swap_result.h"
13 #include "ui/ozone/ozone_base_export.h"
14
15 namespace gfx {
16 class Size;
17 class VSyncProvider;
18 }
19
20 namespace ui {
21 class NativePixmap;
22
23 typedef base::Callback<void(gfx::SwapResult)> SwapCompletionCallback;
24
25 // Holds callbacks to functions for configuring EGL on platform.
26 struct OZONE_BASE_EXPORT EglConfigCallbacks {
27 EglConfigCallbacks();
28 EglConfigCallbacks(const EglConfigCallbacks& other);
29 ~EglConfigCallbacks();
30 base::Callback<bool(const int32_t* attribs,
31 void** /* EGLConfig* */ configs,
32 int32_t config_size,
33 int32_t* num_configs)>
34 choose_config;
35 base::Callback<
36 bool(void* /* EGLConfig */ config, int32_t attribute, int32_t* value)>
37 get_config_attribute;
38 base::Callback<const char*()> get_last_error_string;
39 };
40
41 // The platform-specific part of an EGL surface.
42 //
43 // This class owns any bits that the ozone implementation needs freed when
44 // the EGL surface is destroyed.
45 class OZONE_BASE_EXPORT SurfaceOzoneEGL {
46 public:
47 virtual ~SurfaceOzoneEGL() {}
48
49 // Returns the EGL native window for rendering onto this surface.
50 // This can be used to to create a GLSurface.
51 virtual intptr_t /* EGLNativeWindowType */ GetNativeWindow() = 0;
52
53 // Attempts to resize the EGL native window to match the viewport
54 // size.
55 virtual bool ResizeNativeWindow(const gfx::Size& viewport_size) = 0;
56
57 // Called after we swap buffers. This is usually a no-op but can
58 // be used to present the new front buffer if the platform requires this.
59 virtual bool OnSwapBuffers() = 0;
60
61 // Called after we swap buffers. This is usually a no-op but can
62 // be used to present the new front buffer if the platform requires this.
63 // The callback should be run on the calling thread
64 // (i.e. same thread SwapBuffersAsync is called).
65 virtual void OnSwapBuffersAsync(const SwapCompletionCallback& callback) = 0;
66
67 // Returns a gfx::VsyncProvider for this surface. Note that this may be
68 // called after we have entered the sandbox so if there are operations (e.g.
69 // opening a file descriptor providing vsync events) that must be done
70 // outside of the sandbox, they must have been completed in
71 // InitializeHardware. Returns an empty scoped_ptr on error.
72 virtual std::unique_ptr<gfx::VSyncProvider> CreateVSyncProvider() = 0;
73
74 // Returns true if the surface is created on a UDL device.
75 virtual bool IsUniversalDisplayLinkDevice();
76
77 // Returns the EGL configuration to use for this surface. The default EGL
78 // configuration will be used if this returns nullptr.
79 virtual void* /* EGLConfig */ GetEGLSurfaceConfig(
80 const EglConfigCallbacks& egl) = 0;
81 };
82
83 } // namespace ui
84
85 #endif // UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_
OLDNEW
« no previous file with comments | « ui/ozone/public/surface_factory_ozone.cc ('k') | ui/ozone/public/surface_ozone_egl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698