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

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

Issue 1171513002: Reland of Revert of ozone: Remove singleton pattern for SurfaceFactoryOzone. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ 5 #ifndef UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_
6 #define UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ 6 #define UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_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 "base/native_library.h" 10 #include "base/native_library.h"
11 #include "ui/gfx/geometry/point.h"
12 #include "ui/gfx/geometry/rect.h"
13 #include "ui/gfx/geometry/rect.h" 11 #include "ui/gfx/geometry/rect.h"
14 #include "ui/gfx/native_widget_types.h" 12 #include "ui/gfx/native_widget_types.h"
15 #include "ui/gfx/overlay_transform.h" 13 #include "ui/gfx/overlay_transform.h"
16 #include "ui/ozone/ozone_base_export.h" 14 #include "ui/ozone/ozone_base_export.h"
17 15
18 class SkBitmap;
19 class SkCanvas;
20
21 namespace ui { 16 namespace ui {
22 17
23 class NativePixmap; 18 class NativePixmap;
24 class SurfaceOzoneCanvas; 19 class SurfaceOzoneCanvas;
25 class SurfaceOzoneEGL; 20 class SurfaceOzoneEGL;
26 21
27 // The Ozone interface allows external implementations to hook into Chromium to 22 // The Ozone interface allows external implementations to hook into Chromium to
28 // provide a system specific implementation. The Ozone interface supports two 23 // provide a system specific implementation. The Ozone interface supports two
29 // drawing modes: 1) accelerated drawing through EGL and 2) software drawing 24 // drawing modes: 1) accelerated drawing through EGL and 2) software drawing
30 // through Skia. 25 // through Skia.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 MAP, 66 MAP,
72 PERSISTENT_MAP, 67 PERSISTENT_MAP,
73 SCANOUT, 68 SCANOUT,
74 }; 69 };
75 70
76 typedef void* (*GLGetProcAddressProc)(const char* name); 71 typedef void* (*GLGetProcAddressProc)(const char* name);
77 typedef base::Callback<void(base::NativeLibrary)> AddGLLibraryCallback; 72 typedef base::Callback<void(base::NativeLibrary)> AddGLLibraryCallback;
78 typedef base::Callback<void(GLGetProcAddressProc)> 73 typedef base::Callback<void(GLGetProcAddressProc)>
79 SetGLGetProcAddressProcCallback; 74 SetGLGetProcAddressProcCallback;
80 75
81 SurfaceFactoryOzone();
82 virtual ~SurfaceFactoryOzone();
83
84 // Returns the singleton instance.
85 static SurfaceFactoryOzone* GetInstance();
86
87 // Returns native platform display handle. This is used to obtain the EGL 76 // Returns native platform display handle. This is used to obtain the EGL
88 // display connection for the native display. 77 // display connection for the native display.
89 virtual intptr_t GetNativeDisplay(); 78 virtual intptr_t GetNativeDisplay();
90 79
91 // Create SurfaceOzoneEGL for the specified gfx::AcceleratedWidget. 80 // Create SurfaceOzoneEGL for the specified gfx::AcceleratedWidget.
92 // 81 //
93 // Note: When used from content, this is called in the GPU process. The 82 // Note: When used from content, this is called in the GPU process. The
94 // platform must support creation of SurfaceOzoneEGL from the GPU process 83 // platform must support creation of SurfaceOzoneEGL from the GPU process
95 // using only the handle contained in gfx::AcceleratedWidget. 84 // using only the handle contained in gfx::AcceleratedWidget.
96 virtual scoped_ptr<SurfaceOzoneEGL> CreateEGLSurfaceForWidget( 85 virtual scoped_ptr<SurfaceOzoneEGL> CreateEGLSurfaceForWidget(
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 141
153 // Returns true if overlays can be shown at z-index 0, replacing the main 142 // Returns true if overlays can be shown at z-index 0, replacing the main
154 // surface. Combined with surfaceless extensions, it allows for an 143 // surface. Combined with surfaceless extensions, it allows for an
155 // overlay-only mode. 144 // overlay-only mode.
156 virtual bool CanShowPrimaryPlaneAsOverlay(); 145 virtual bool CanShowPrimaryPlaneAsOverlay();
157 146
158 // Returns true if the platform is able to create buffers for a specific usage 147 // Returns true if the platform is able to create buffers for a specific usage
159 // such as MAP for zero copy or SCANOUT for display controller. 148 // such as MAP for zero copy or SCANOUT for display controller.
160 virtual bool CanCreateNativePixmap(BufferUsage usage); 149 virtual bool CanCreateNativePixmap(BufferUsage usage);
161 150
151 protected:
152 SurfaceFactoryOzone();
153 virtual ~SurfaceFactoryOzone();
154
162 private: 155 private:
163 static SurfaceFactoryOzone* impl_; // not owned 156 DISALLOW_COPY_AND_ASSIGN(SurfaceFactoryOzone);
164 }; 157 };
165 158
166 } // namespace ui 159 } // namespace ui
167 160
168 #endif // UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ 161 #endif // UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698