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

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

Issue 10795058: Add GL surface creation for Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add interface for surface lookup Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/gpu/gpu_surface_tracker.h ('k') | content/common/gpu/gpu_surface_lookup.h » ('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 #include "content/browser/gpu/gpu_surface_tracker.h" 5 #include "content/browser/gpu/gpu_surface_tracker.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 GpuSurfaceTracker::GpuSurfaceTracker() 9 GpuSurfaceTracker::GpuSurfaceTracker()
10 : next_surface_id_(1) { 10 : next_surface_id_(1) {
11 GpuSurfaceLookup::InitInstance(this);
11 } 12 }
12 13
13 GpuSurfaceTracker::~GpuSurfaceTracker() { 14 GpuSurfaceTracker::~GpuSurfaceTracker() {
piman 2012/07/26 23:55:52 It'd be good to have a GpuSurfaceLookup::ResetInst
14 } 15 }
15 16
16 GpuSurfaceTracker* GpuSurfaceTracker::GetInstance() { 17 GpuSurfaceTracker* GpuSurfaceTracker::GetInstance() {
apatrick_chromium 2012/07/26 23:54:21 Why not delete this GetInstance and just use the o
17 return Singleton<GpuSurfaceTracker>::get(); 18 return Singleton<GpuSurfaceTracker>::get();
18 } 19 }
19 20
20 int GpuSurfaceTracker::AddSurfaceForRenderer(int renderer_id, 21 int GpuSurfaceTracker::AddSurfaceForRenderer(int renderer_id,
21 int render_widget_id) { 22 int render_widget_id) {
22 base::AutoLock lock(lock_); 23 base::AutoLock lock(lock_);
23 SurfaceInfo info = { 24 SurfaceInfo info = {
24 renderer_id, 25 renderer_id,
25 render_widget_id, 26 render_widget_id,
26 gfx::kNullAcceleratedWidget 27 gfx::kNullAcceleratedWidget
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 88 }
88 89
89 gfx::PluginWindowHandle GpuSurfaceTracker::GetSurfaceWindowHandle( 90 gfx::PluginWindowHandle GpuSurfaceTracker::GetSurfaceWindowHandle(
90 int surface_id) { 91 int surface_id) {
91 base::AutoLock lock(lock_); 92 base::AutoLock lock(lock_);
92 SurfaceMap::iterator it = surface_map_.find(surface_id); 93 SurfaceMap::iterator it = surface_map_.find(surface_id);
93 if (it == surface_map_.end()) 94 if (it == surface_map_.end())
94 return gfx::kNullPluginWindow; 95 return gfx::kNullPluginWindow;
95 return it->second.handle.handle; 96 return it->second.handle.handle;
96 } 97 }
98
99 gfx::AcceleratedWidget GpuSurfaceTracker::GetNativeWidget(int surface_id) {
100 base::AutoLock lock(lock_);
101 SurfaceMap::iterator it = surface_map_.find(surface_id);
102 if (it == surface_map_.end())
103 return gfx::kNullAcceleratedWidget;
104 return it->second.native_widget;
105 }
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_surface_tracker.h ('k') | content/common/gpu/gpu_surface_lookup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698