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

Side by Side Diff: content/browser/gpu/gpu_surface_tracker.h

Issue 2190033002: content: Add ContextProviderFactory to create a render ContextProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove display_ DCHECK. 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
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 CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_ 5 #ifndef CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_
6 #define CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_ 6 #define CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 30 matching lines...) Expand all
41 #if defined(OS_ANDROID) 41 #if defined(OS_ANDROID)
42 gl::ScopedJavaSurface AcquireJavaSurface(int surface_id) override; 42 gl::ScopedJavaSurface AcquireJavaSurface(int surface_id) override;
43 #endif 43 #endif
44 44
45 // Gets the global instance of the surface tracker. 45 // Gets the global instance of the surface tracker.
46 static GpuSurfaceTracker* Get() { return GetInstance(); } 46 static GpuSurfaceTracker* Get() { return GetInstance(); }
47 47
48 // Adds a surface for a native widget. Returns the surface ID. 48 // Adds a surface for a native widget. Returns the surface ID.
49 int AddSurfaceForNativeWidget(gfx::AcceleratedWidget widget); 49 int AddSurfaceForNativeWidget(gfx::AcceleratedWidget widget);
50 50
51 // Return true if the surface handle is registered with the tracker.
52 bool IsValidSurfaceHandle(gpu::SurfaceHandle surface_handle) const;
53
51 // Removes a given existing surface. 54 // Removes a given existing surface.
52 void RemoveSurface(gpu::SurfaceHandle surface_handle); 55 void RemoveSurface(gpu::SurfaceHandle surface_handle);
53 56
54 // Returns the number of surfaces currently registered with the tracker. 57 // Returns the number of surfaces currently registered with the tracker.
55 std::size_t GetSurfaceCount(); 58 std::size_t GetSurfaceCount();
56 59
57 // Gets the global instance of the surface tracker. Identical to Get(), but 60 // Gets the global instance of the surface tracker. Identical to Get(), but
58 // named that way for the implementation of Singleton. 61 // named that way for the implementation of Singleton.
59 static GpuSurfaceTracker* GetInstance(); 62 static GpuSurfaceTracker* GetInstance();
60 63
61 private: 64 private:
62 typedef std::map<gpu::SurfaceHandle, gfx::AcceleratedWidget> SurfaceMap; 65 typedef std::map<gpu::SurfaceHandle, gfx::AcceleratedWidget> SurfaceMap;
63 66
64 friend struct base::DefaultSingletonTraits<GpuSurfaceTracker>; 67 friend struct base::DefaultSingletonTraits<GpuSurfaceTracker>;
65 68
66 GpuSurfaceTracker(); 69 GpuSurfaceTracker();
67 ~GpuSurfaceTracker() override; 70 ~GpuSurfaceTracker() override;
68 71
69 base::Lock lock_; 72 base::Lock lock_;
70 SurfaceMap surface_map_; 73 SurfaceMap surface_map_;
71 int next_surface_handle_; 74 int next_surface_handle_;
72 75
73 DISALLOW_COPY_AND_ASSIGN(GpuSurfaceTracker); 76 DISALLOW_COPY_AND_ASSIGN(GpuSurfaceTracker);
74 }; 77 };
75 78
76 } // namespace content 79 } // namespace content
77 80
78 #endif // CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_ 81 #endif // CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_widget_host_view_guest_unittest.cc ('k') | content/browser/gpu/gpu_surface_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698