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

Side by Side Diff: content/browser/compositor/software_output_device_ozone.cc

Issue 1171513002: Reland of Revert of ozone: Remove singleton pattern for SurfaceFactoryOzone. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 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/software_output_device_ozone.h" 5 #include "content/browser/compositor/software_output_device_ozone.h"
6 #include "third_party/skia/include/core/SkDevice.h" 6 #include "third_party/skia/include/core/SkDevice.h"
7 #include "ui/compositor/compositor.h" 7 #include "ui/compositor/compositor.h"
8 #include "ui/gfx/skia_util.h" 8 #include "ui/gfx/skia_util.h"
9 #include "ui/gfx/vsync_provider.h" 9 #include "ui/gfx/vsync_provider.h"
10 #include "ui/ozone/public/ozone_platform.h"
10 #include "ui/ozone/public/surface_factory_ozone.h" 11 #include "ui/ozone/public/surface_factory_ozone.h"
11 #include "ui/ozone/public/surface_ozone_canvas.h" 12 #include "ui/ozone/public/surface_ozone_canvas.h"
12 13
13 namespace content { 14 namespace content {
14 15
15 SoftwareOutputDeviceOzone::SoftwareOutputDeviceOzone(ui::Compositor* compositor) 16 SoftwareOutputDeviceOzone::SoftwareOutputDeviceOzone(ui::Compositor* compositor)
16 : compositor_(compositor) { 17 : compositor_(compositor) {
17 ui::SurfaceFactoryOzone* factory = ui::SurfaceFactoryOzone::GetInstance(); 18 ui::SurfaceFactoryOzone* factory =
19 ui::OzonePlatform::GetInstance()->GetSurfaceFactoryOzone();
18 20
19 surface_ozone_ = factory->CreateCanvasForWidget(compositor_->widget()); 21 surface_ozone_ = factory->CreateCanvasForWidget(compositor_->widget());
20 22
21 if (!surface_ozone_) 23 if (!surface_ozone_)
22 LOG(FATAL) << "Failed to initialize canvas"; 24 LOG(FATAL) << "Failed to initialize canvas";
23 25
24 vsync_provider_ = surface_ozone_->CreateVSyncProvider(); 26 vsync_provider_ = surface_ozone_->CreateVSyncProvider();
25 } 27 }
26 28
27 SoftwareOutputDeviceOzone::~SoftwareOutputDeviceOzone() { 29 SoftwareOutputDeviceOzone::~SoftwareOutputDeviceOzone() {
(...skipping 20 matching lines...) Expand all
48 return SoftwareOutputDevice::BeginPaint(damage_rect); 50 return SoftwareOutputDevice::BeginPaint(damage_rect);
49 } 51 }
50 52
51 void SoftwareOutputDeviceOzone::EndPaint(cc::SoftwareFrameData* frame_data) { 53 void SoftwareOutputDeviceOzone::EndPaint(cc::SoftwareFrameData* frame_data) {
52 SoftwareOutputDevice::EndPaint(frame_data); 54 SoftwareOutputDevice::EndPaint(frame_data);
53 55
54 surface_ozone_->PresentCanvas(damage_rect_); 56 surface_ozone_->PresentCanvas(damage_rect_);
55 } 57 }
56 58
57 } // namespace content 59 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc » ('j') | ui/ozone/demo/software_renderer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698