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

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

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

Powered by Google App Engine
This is Rietveld 408576698