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

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

Issue 1823763003: Move more files to gpu/ipc/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed GYP build Created 4 years, 9 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 | « content/browser/gpu/gpu_process_host.cc ('k') | content/browser/gpu/gpu_surface_tracker.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) 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>
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 "base/memory/singleton.h" 14 #include "base/memory/singleton.h"
15 #include "base/synchronization/lock.h" 15 #include "base/synchronization/lock.h"
16 #include "content/common/content_export.h" 16 #include "content/common/content_export.h"
17 #include "content/common/gpu/gpu_surface_lookup.h" 17 #include "gpu/ipc/common/gpu_surface_lookup.h"
18 #include "gpu/ipc/common/surface_handle.h" 18 #include "gpu/ipc/common/surface_handle.h"
19 #include "ui/gfx/geometry/size.h" 19 #include "ui/gfx/geometry/size.h"
20 #include "ui/gfx/native_widget_types.h" 20 #include "ui/gfx/native_widget_types.h"
21 21
22 namespace content { 22 namespace content {
23 23
24 // This class is responsible for managing rendering surfaces exposed to the 24 // This class is responsible for managing rendering surfaces exposed to the
25 // GPU process. Every surface gets registered to this class, and gets an ID. 25 // GPU process. Every surface gets registered to this class, and gets an ID.
26 // All calls to and from the GPU process, with the exception of 26 // All calls to and from the GPU process, with the exception of
27 // CreateViewCommandBuffer, refer to the rendering surface by its ID. 27 // CreateViewCommandBuffer, refer to the rendering surface by its ID.
28 // This class is thread safe. 28 // This class is thread safe.
29 // 29 //
30 // Note: The ID can exist before the actual native handle for the surface is 30 // Note: The ID can exist before the actual native handle for the surface is
31 // created, for example to allow giving a reference to it to a renderer, so that 31 // created, for example to allow giving a reference to it to a renderer, so that
32 // it is unamibiguously identified. 32 // it is unamibiguously identified.
33 class CONTENT_EXPORT GpuSurfaceTracker : public GpuSurfaceLookup { 33 class CONTENT_EXPORT GpuSurfaceTracker : public gpu::GpuSurfaceLookup {
34 public: 34 public:
35 // GpuSurfaceLookup implementation: 35 // GpuSurfaceLookup implementation:
36 // Returns the native widget associated with a given surface_id. 36 // Returns the native widget associated with a given surface_id.
37 gfx::AcceleratedWidget AcquireNativeWidget(int surface_id) override; 37 gfx::AcceleratedWidget AcquireNativeWidget(int surface_id) override;
38 38
39 // Gets the global instance of the surface tracker. 39 // Gets the global instance of the surface tracker.
40 static GpuSurfaceTracker* Get() { return GetInstance(); } 40 static GpuSurfaceTracker* Get() { return GetInstance(); }
41 41
42 // Adds a surface for a native widget. Returns the surface ID. 42 // Adds a surface for a native widget. Returns the surface ID.
43 int AddSurfaceForNativeWidget(gfx::AcceleratedWidget widget); 43 int AddSurfaceForNativeWidget(gfx::AcceleratedWidget widget);
(...skipping 23 matching lines...) Expand all
67 base::Lock lock_; 67 base::Lock lock_;
68 SurfaceMap surface_map_; 68 SurfaceMap surface_map_;
69 int next_surface_id_; 69 int next_surface_id_;
70 70
71 DISALLOW_COPY_AND_ASSIGN(GpuSurfaceTracker); 71 DISALLOW_COPY_AND_ASSIGN(GpuSurfaceTracker);
72 }; 72 };
73 73
74 } // namespace content 74 } // namespace content
75 75
76 #endif // CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_ 76 #endif // CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_process_host.cc ('k') | content/browser/gpu/gpu_surface_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698