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

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

Issue 2190033002: content: Add ContextProviderFactory to create a render ContextProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove display_ DCHECK. Created 4 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
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)
(...skipping 18 matching lines...) Expand all
29 } 29 }
30 30
31 int GpuSurfaceTracker::AddSurfaceForNativeWidget( 31 int GpuSurfaceTracker::AddSurfaceForNativeWidget(
32 gfx::AcceleratedWidget widget) { 32 gfx::AcceleratedWidget widget) {
33 base::AutoLock lock(lock_); 33 base::AutoLock lock(lock_);
34 gpu::SurfaceHandle surface_handle = next_surface_handle_++; 34 gpu::SurfaceHandle surface_handle = next_surface_handle_++;
35 surface_map_[surface_handle] = widget; 35 surface_map_[surface_handle] = widget;
36 return surface_handle; 36 return surface_handle;
37 } 37 }
38 38
39 bool GpuSurfaceTracker::IsValidSurfaceHandle(
40 gpu::SurfaceHandle surface_handle) const {
41 return surface_map_.find(surface_handle) != surface_map_.end();
42 }
43
39 void GpuSurfaceTracker::RemoveSurface(gpu::SurfaceHandle surface_handle) { 44 void GpuSurfaceTracker::RemoveSurface(gpu::SurfaceHandle surface_handle) {
40 base::AutoLock lock(lock_); 45 base::AutoLock lock(lock_);
41 DCHECK(surface_map_.find(surface_handle) != surface_map_.end()); 46 DCHECK(surface_map_.find(surface_handle) != surface_map_.end());
42 surface_map_.erase(surface_handle); 47 surface_map_.erase(surface_handle);
43 } 48 }
44 49
45 gfx::AcceleratedWidget GpuSurfaceTracker::AcquireNativeWidget( 50 gfx::AcceleratedWidget GpuSurfaceTracker::AcquireNativeWidget(
46 gpu::SurfaceHandle surface_handle) { 51 gpu::SurfaceHandle surface_handle) {
47 base::AutoLock lock(lock_); 52 base::AutoLock lock(lock_);
48 SurfaceMap::iterator it = surface_map_.find(surface_handle); 53 SurfaceMap::iterator it = surface_map_.find(surface_handle);
(...skipping 13 matching lines...) Expand all
62 return GetViewSurface(surface_id); 67 return GetViewSurface(surface_id);
63 } 68 }
64 #endif 69 #endif
65 70
66 std::size_t GpuSurfaceTracker::GetSurfaceCount() { 71 std::size_t GpuSurfaceTracker::GetSurfaceCount() {
67 base::AutoLock lock(lock_); 72 base::AutoLock lock(lock_);
68 return surface_map_.size(); 73 return surface_map_.size();
69 } 74 }
70 75
71 } // namespace content 76 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_surface_tracker.h ('k') | content/browser/renderer_host/compositor_impl_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698