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 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
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 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #if defined(OS_ANDROID) 10 #if defined(OS_ANDROID)
11 #include <android/native_window_jni.h> 11 #include <android/native_window_jni.h>
12 #endif // defined(OS_ANDROID) 12 #endif // defined(OS_ANDROID)
13 13
14 namespace content { 14 namespace content {
15 15
16 GpuSurfaceTracker::GpuSurfaceTracker() 16 GpuSurfaceTracker::GpuSurfaceTracker()
17 : next_surface_id_(1) { 17 : next_surface_id_(1) {
18 GpuSurfaceLookup::InitInstance(this); 18 gpu::GpuSurfaceLookup::InitInstance(this);
19 } 19 }
20 20
21 GpuSurfaceTracker::~GpuSurfaceTracker() { 21 GpuSurfaceTracker::~GpuSurfaceTracker() {
22 GpuSurfaceLookup::InitInstance(NULL); 22 gpu::GpuSurfaceLookup::InitInstance(NULL);
23 } 23 }
24 24
25 GpuSurfaceTracker* GpuSurfaceTracker::GetInstance() { 25 GpuSurfaceTracker* GpuSurfaceTracker::GetInstance() {
26 return base::Singleton<GpuSurfaceTracker>::get(); 26 return base::Singleton<GpuSurfaceTracker>::get();
27 } 27 }
28 28
29 int GpuSurfaceTracker::AddSurfaceForNativeWidget( 29 int GpuSurfaceTracker::AddSurfaceForNativeWidget(
30 gfx::AcceleratedWidget widget) { 30 gfx::AcceleratedWidget widget) {
31 base::AutoLock lock(lock_); 31 base::AutoLock lock(lock_);
32 int surface_id = next_surface_id_++; 32 int surface_id = next_surface_id_++;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 return it->second; 74 return it->second;
75 } 75 }
76 76
77 std::size_t GpuSurfaceTracker::GetSurfaceCount() { 77 std::size_t GpuSurfaceTracker::GetSurfaceCount() {
78 base::AutoLock lock(lock_); 78 base::AutoLock lock(lock_);
79 return surface_map_.size(); 79 return surface_map_.size();
80 } 80 }
81 81
82 } // namespace content 82 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_surface_tracker.h ('k') | content/common/gpu/gpu_channel_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698