Chromium Code Reviews| Index: content/browser/gpu/gpu_surface_tracker.cc |
| diff --git a/content/browser/gpu/gpu_surface_tracker.cc b/content/browser/gpu/gpu_surface_tracker.cc |
| index 21e293825a4160eff529298abd9a5a1fb7bd411d..2cdd743e90e54ffcb3c20dcf44dc149a5486b297 100644 |
| --- a/content/browser/gpu/gpu_surface_tracker.cc |
| +++ b/content/browser/gpu/gpu_surface_tracker.cc |
| @@ -7,11 +7,15 @@ |
| #include "base/logging.h" |
| #if defined(OS_WIN) |
| +#include "content/browser/gpu/gpu_surface_reader_win.h" |
| #include "ui/gfx/surface/accelerated_surface_win.h" |
| #endif |
| GpuSurfaceTracker::GpuSurfaceTracker() |
| : next_surface_id_(1) { |
| +#if defined(OS_WIN) |
| + reader_.reset(new GpuSurfaceReader); |
|
apatrick_chromium
2012/03/07 20:39:37
And if CopySurface was a free function, this would
mazda
2012/03/08 13:14:28
Now I moved the code in CopySurface to RenderWidge
|
| +#endif |
| } |
| GpuSurfaceTracker::~GpuSurfaceTracker() { |
| @@ -90,6 +94,22 @@ gfx::GLSurfaceHandle GpuSurfaceTracker::GetSurfaceHandle(int surface_id) { |
| return surface_map_[surface_id].handle; |
| } |
| +bool GpuSurfaceTracker::CopySurface(int surface_id, |
| + const gfx::Size& size, |
| + std::vector<unsigned char>* out) { |
| + base::AutoLock lock(lock_); |
| +#if defined(OS_WIN) |
|
piman
2012/03/07 21:22:27
&& !defined(USE_AURA)
mazda
2012/03/08 13:14:28
Now I moved the code in CopySurface to RenderWidge
|
| + SurfaceMap::const_iterator itr = surface_map_.find(surface_id); |
| + if (itr == surface_map_.end()) |
| + return false; |
| + return reader_->CopySurface(itr->second, size, out); |
| +#else |
| + // TOOD(mazda): Implement this on other platforms. |
| + NOTIMPLEMENTED(); |
| + return false; |
| +#endif |
| +} |
| + |
| #if defined(OS_WIN) && !defined(USE_AURA) |
| void GpuSurfaceTracker::AsyncPresentAndAcknowledge( |
| @@ -113,4 +133,3 @@ void GpuSurfaceTracker::AsyncPresentAndAcknowledge( |
| } |
| #endif // OS_WIN |
| - |