| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/compositor/onscreen_display_client.h" | 5 #include "content/browser/compositor/onscreen_display_client.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "cc/output/output_surface.h" | 8 #include "cc/output/output_surface.h" |
| 9 #include "cc/surfaces/surface_factory.h" | 9 #include "cc/surfaces/surface_factory.h" |
| 10 #include "cc/surfaces/surface_manager.h" | 10 #include "cc/surfaces/surface_manager.h" |
| 11 #include "content/browser/compositor/surface_display_output_surface.h" | 11 #include "content/browser/compositor/surface_display_output_surface.h" |
| 12 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
| 12 #include "content/common/host_shared_bitmap_manager.h" | 13 #include "content/common/host_shared_bitmap_manager.h" |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 | 16 |
| 16 OnscreenDisplayClient::OnscreenDisplayClient( | 17 OnscreenDisplayClient::OnscreenDisplayClient( |
| 17 scoped_ptr<cc::OutputSurface> output_surface, | 18 scoped_ptr<cc::OutputSurface> output_surface, |
| 18 cc::SurfaceManager* manager, | 19 cc::SurfaceManager* manager, |
| 19 scoped_refptr<base::SingleThreadTaskRunner> task_runner) | 20 scoped_refptr<base::SingleThreadTaskRunner> task_runner) |
| 20 : output_surface_(output_surface.Pass()), | 21 : output_surface_(output_surface.Pass()), |
| 21 display_( | 22 display_(new cc::Display(this, |
| 22 new cc::Display(this, manager, HostSharedBitmapManager::current())), | 23 manager, |
| 24 HostSharedBitmapManager::current(), |
| 25 BrowserGpuMemoryBufferManager::current())), |
| 23 task_runner_(task_runner), | 26 task_runner_(task_runner), |
| 24 scheduled_draw_(false), | 27 scheduled_draw_(false), |
| 25 deferred_draw_(false), | 28 deferred_draw_(false), |
| 26 pending_frames_(0), | 29 pending_frames_(0), |
| 27 weak_ptr_factory_(this) { | 30 weak_ptr_factory_(this) { |
| 28 } | 31 } |
| 29 | 32 |
| 30 OnscreenDisplayClient::~OnscreenDisplayClient() { | 33 OnscreenDisplayClient::~OnscreenDisplayClient() { |
| 31 } | 34 } |
| 32 | 35 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 ScheduleDraw(); | 83 ScheduleDraw(); |
| 81 } | 84 } |
| 82 } | 85 } |
| 83 | 86 |
| 84 void OnscreenDisplayClient::SetMemoryPolicy( | 87 void OnscreenDisplayClient::SetMemoryPolicy( |
| 85 const cc::ManagedMemoryPolicy& policy) { | 88 const cc::ManagedMemoryPolicy& policy) { |
| 86 surface_display_output_surface_->SetMemoryPolicy(policy); | 89 surface_display_output_surface_->SetMemoryPolicy(policy); |
| 87 } | 90 } |
| 88 | 91 |
| 89 } // namespace content | 92 } // namespace content |
| OLD | NEW |