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

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: Created 8 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 | 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() {
15 GpuSurfaceLookup::InitInstance(NULL);
14 } 16 }
15 17
16 GpuSurfaceTracker* GpuSurfaceTracker::GetInstance() { 18 GpuSurfaceTracker* GpuSurfaceTracker::GetInstance() {
17 return Singleton<GpuSurfaceTracker>::get(); 19 return Singleton<GpuSurfaceTracker>::get();
18 } 20 }
19 21
20 int GpuSurfaceTracker::AddSurfaceForRenderer(int renderer_id, 22 int GpuSurfaceTracker::AddSurfaceForRenderer(int renderer_id,
21 int render_widget_id) { 23 int render_widget_id) {
22 base::AutoLock lock(lock_); 24 base::AutoLock lock(lock_);
23 SurfaceInfo info = { 25 SurfaceInfo info = {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 89 }
88 90
89 gfx::PluginWindowHandle GpuSurfaceTracker::GetSurfaceWindowHandle( 91 gfx::PluginWindowHandle GpuSurfaceTracker::GetSurfaceWindowHandle(
90 int surface_id) { 92 int surface_id) {
91 base::AutoLock lock(lock_); 93 base::AutoLock lock(lock_);
92 SurfaceMap::iterator it = surface_map_.find(surface_id); 94 SurfaceMap::iterator it = surface_map_.find(surface_id);
93 if (it == surface_map_.end()) 95 if (it == surface_map_.end())
94 return gfx::kNullPluginWindow; 96 return gfx::kNullPluginWindow;
95 return it->second.handle.handle; 97 return it->second.handle.handle;
96 } 98 }
99
100 gfx::AcceleratedWidget GpuSurfaceTracker::GetNativeWidget(int surface_id) {
101 base::AutoLock lock(lock_);
102 SurfaceMap::iterator it = surface_map_.find(surface_id);
103 if (it == surface_map_.end())
104 return gfx::kNullAcceleratedWidget;
105 return it->second.native_widget;
106 }
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