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

Side by Side Diff: cc/output/software_output_device.cc

Issue 1855273002: Update new Surface callsites (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: software_output_device was indirectly including skia::refptr, switch to sk_sp<> Created 4 years, 8 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
« no previous file with comments | « cc/output/software_output_device.h ('k') | cc/output/software_renderer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "cc/output/software_output_device.h" 5 #include "cc/output/software_output_device.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/skia/include/core/SkCanvas.h" 8 #include "third_party/skia/include/core/SkCanvas.h"
9 #include "ui/gfx/vsync_provider.h" 9 #include "ui/gfx/vsync_provider.h"
10 10
11 namespace cc { 11 namespace cc {
12 12
13 SoftwareOutputDevice::SoftwareOutputDevice() : scale_factor_(1.f) { 13 SoftwareOutputDevice::SoftwareOutputDevice() : scale_factor_(1.f) {
14 } 14 }
15 15
16 SoftwareOutputDevice::~SoftwareOutputDevice() {} 16 SoftwareOutputDevice::~SoftwareOutputDevice() {}
17 17
18 void SoftwareOutputDevice::Resize(const gfx::Size& viewport_pixel_size, 18 void SoftwareOutputDevice::Resize(const gfx::Size& viewport_pixel_size,
19 float scale_factor) { 19 float scale_factor) {
20 scale_factor_ = scale_factor; 20 scale_factor_ = scale_factor;
21 21
22 if (viewport_pixel_size_ == viewport_pixel_size) 22 if (viewport_pixel_size_ == viewport_pixel_size)
23 return; 23 return;
24 24
25 SkImageInfo info = SkImageInfo::MakeN32(viewport_pixel_size.width(), 25 SkImageInfo info = SkImageInfo::MakeN32(viewport_pixel_size.width(),
26 viewport_pixel_size.height(), 26 viewport_pixel_size.height(),
27 kOpaque_SkAlphaType); 27 kOpaque_SkAlphaType);
28 viewport_pixel_size_ = viewport_pixel_size; 28 viewport_pixel_size_ = viewport_pixel_size;
29 surface_ = skia::AdoptRef(SkSurface::NewRaster(info)); 29 surface_ = SkSurface::MakeRaster(info);
30 } 30 }
31 31
32 SkCanvas* SoftwareOutputDevice::BeginPaint(const gfx::Rect& damage_rect) { 32 SkCanvas* SoftwareOutputDevice::BeginPaint(const gfx::Rect& damage_rect) {
33 damage_rect_ = damage_rect; 33 damage_rect_ = damage_rect;
34 return surface_ ? surface_->getCanvas() : nullptr; 34 return surface_ ? surface_->getCanvas() : nullptr;
35 } 35 }
36 36
37 void SoftwareOutputDevice::EndPaint() {} 37 void SoftwareOutputDevice::EndPaint() {}
38 38
39 gfx::VSyncProvider* SoftwareOutputDevice::GetVSyncProvider() { 39 gfx::VSyncProvider* SoftwareOutputDevice::GetVSyncProvider() {
40 return vsync_provider_.get(); 40 return vsync_provider_.get();
41 } 41 }
42 42
43 } // namespace cc 43 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/software_output_device.h ('k') | cc/output/software_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698