| OLD | NEW |
| 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 namespace content { |
| 10 |
| 9 GpuSurfaceTracker::GpuSurfaceTracker() | 11 GpuSurfaceTracker::GpuSurfaceTracker() |
| 10 : next_surface_id_(1) { | 12 : next_surface_id_(1) { |
| 11 GpuSurfaceLookup::InitInstance(this); | 13 GpuSurfaceLookup::InitInstance(this); |
| 12 } | 14 } |
| 13 | 15 |
| 14 GpuSurfaceTracker::~GpuSurfaceTracker() { | 16 GpuSurfaceTracker::~GpuSurfaceTracker() { |
| 15 GpuSurfaceLookup::InitInstance(NULL); | 17 GpuSurfaceLookup::InitInstance(NULL); |
| 16 } | 18 } |
| 17 | 19 |
| 18 GpuSurfaceTracker* GpuSurfaceTracker::GetInstance() { | 20 GpuSurfaceTracker* GpuSurfaceTracker::GetInstance() { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 return it->second.handle.handle; | 99 return it->second.handle.handle; |
| 98 } | 100 } |
| 99 | 101 |
| 100 gfx::AcceleratedWidget GpuSurfaceTracker::GetNativeWidget(int surface_id) { | 102 gfx::AcceleratedWidget GpuSurfaceTracker::GetNativeWidget(int surface_id) { |
| 101 base::AutoLock lock(lock_); | 103 base::AutoLock lock(lock_); |
| 102 SurfaceMap::iterator it = surface_map_.find(surface_id); | 104 SurfaceMap::iterator it = surface_map_.find(surface_id); |
| 103 if (it == surface_map_.end()) | 105 if (it == surface_map_.end()) |
| 104 return gfx::kNullAcceleratedWidget; | 106 return gfx::kNullAcceleratedWidget; |
| 105 return it->second.native_widget; | 107 return it->second.native_widget; |
| 106 } | 108 } |
| 109 |
| 110 } // namespace content |
| OLD | NEW |