| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/aura/software_output_device_ozone.h" | 5 #include "content/browser/aura/software_output_device_ozone.h" |
| 6 #include "third_party/skia/include/core/SkBitmapDevice.h" | 6 #include "third_party/skia/include/core/SkBitmapDevice.h" |
| 7 #include "third_party/skia/include/core/SkDevice.h" | 7 #include "third_party/skia/include/core/SkDevice.h" |
| 8 #include "ui/compositor/compositor.h" | 8 #include "ui/compositor/compositor.h" |
| 9 #include "ui/gfx/ozone/surface_factory_ozone.h" | 9 #include "ui/gfx/ozone/surface_factory_ozone.h" |
| 10 #include "ui/gfx/skia_util.h" | 10 #include "ui/gfx/skia_util.h" |
| 11 #include "ui/gfx/vsync_provider.h" | 11 #include "ui/gfx/vsync_provider.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 SoftwareOutputDeviceOzone::SoftwareOutputDeviceOzone(ui::Compositor* compositor) | 15 SoftwareOutputDeviceOzone::SoftwareOutputDeviceOzone(ui::Compositor* compositor) |
| 16 : compositor_(compositor), realized_widget_(gfx::kNullAcceleratedWidget) { | 16 : compositor_(compositor), realized_widget_(gfx::kNullAcceleratedWidget) { |
| 17 gfx::SurfaceFactoryOzone* factory = gfx::SurfaceFactoryOzone::GetInstance(); | 17 gfx::SurfaceFactoryOzone* factory = gfx::SurfaceFactoryOzone::GetInstance(); |
| 18 | 18 |
| 19 if (factory->InitializeHardware() != gfx::SurfaceFactoryOzone::INITIALIZED) | 19 if (factory->InitializeHardware() != gfx::SurfaceFactoryOzone::INITIALIZED) |
| 20 LOG(FATAL) << "Failed to initialize hardware in OZONE"; | 20 LOG(FATAL) << "Failed to initialize hardware in OZONE"; |
| 21 | 21 |
| 22 realized_widget_ = factory->RealizeAcceleratedWidget(compositor_->widget()); | 22 realized_widget_ = factory->RealizeAcceleratedWidget(compositor_->widget()); |
| 23 | 23 |
| 24 if (realized_widget_ == gfx::kNullAcceleratedWidget) | 24 if (realized_widget_ == gfx::kNullAcceleratedWidget) |
| 25 LOG(FATAL) << "Failed to get a realized AcceleratedWidget"; | 25 LOG(FATAL) << "Failed to get a realized AcceleratedWidget"; |
| 26 | 26 |
| 27 vsync_provider_.reset(factory->GetVSyncProvider(realized_widget_)); | 27 vsync_provider_ = factory->CreateVSyncProvider(realized_widget_); |
| 28 } | 28 } |
| 29 | 29 |
| 30 SoftwareOutputDeviceOzone::~SoftwareOutputDeviceOzone() { | 30 SoftwareOutputDeviceOzone::~SoftwareOutputDeviceOzone() { |
| 31 } | 31 } |
| 32 | 32 |
| 33 void SoftwareOutputDeviceOzone::Resize(gfx::Size viewport_size) { | 33 void SoftwareOutputDeviceOzone::Resize(gfx::Size viewport_size) { |
| 34 if (viewport_size_ == viewport_size) | 34 if (viewport_size_ == viewport_size) |
| 35 return; | 35 return; |
| 36 | 36 |
| 37 viewport_size_ = viewport_size; | 37 viewport_size_ = viewport_size; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 64 | 64 |
| 65 if (damage_rect_.IsEmpty()) | 65 if (damage_rect_.IsEmpty()) |
| 66 return; | 66 return; |
| 67 | 67 |
| 68 bool scheduled = gfx::SurfaceFactoryOzone::GetInstance()->SchedulePageFlip( | 68 bool scheduled = gfx::SurfaceFactoryOzone::GetInstance()->SchedulePageFlip( |
| 69 compositor_->widget()); | 69 compositor_->widget()); |
| 70 DCHECK(scheduled) << "Failed to schedule pageflip"; | 70 DCHECK(scheduled) << "Failed to schedule pageflip"; |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // namespace content | 73 } // namespace content |
| OLD | NEW |