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

Unified Diff: cc/output/software_output_device.cc

Issue 297573003: Make delegated software renderer work on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebas Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output/software_output_device.h ('k') | cc/test/pixel_test_software_output_device.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/software_output_device.cc
diff --git a/cc/output/software_output_device.cc b/cc/output/software_output_device.cc
index 93860f16adc967d6e2db72acad6bfa4570d9b277..9e13cf312a37d4cbfe994ec45a0220f29e9b9f37 100644
--- a/cc/output/software_output_device.cc
+++ b/cc/output/software_output_device.cc
@@ -12,17 +12,22 @@
namespace cc {
-SoftwareOutputDevice::SoftwareOutputDevice() {}
+SoftwareOutputDevice::SoftwareOutputDevice() : scale_factor_(1.f) {
+}
SoftwareOutputDevice::~SoftwareOutputDevice() {}
-void SoftwareOutputDevice::Resize(const gfx::Size& viewport_size) {
- if (viewport_size_ == viewport_size)
+void SoftwareOutputDevice::Resize(const gfx::Size& viewport_pixel_size,
+ float scale_factor) {
+ scale_factor_ = scale_factor;
+
+ if (viewport_pixel_size_ == viewport_pixel_size)
return;
- SkImageInfo info = SkImageInfo::MakeN32(
- viewport_size.width(), viewport_size.height(), kOpaque_SkAlphaType);
- viewport_size_ = viewport_size;
+ SkImageInfo info = SkImageInfo::MakeN32(viewport_pixel_size.width(),
+ viewport_pixel_size.height(),
+ kOpaque_SkAlphaType);
+ viewport_pixel_size_ = viewport_pixel_size;
canvas_ = skia::AdoptRef(SkCanvas::NewRaster(info));
}
@@ -35,7 +40,7 @@ SkCanvas* SoftwareOutputDevice::BeginPaint(const gfx::Rect& damage_rect) {
void SoftwareOutputDevice::EndPaint(SoftwareFrameData* frame_data) {
DCHECK(frame_data);
frame_data->id = 0;
- frame_data->size = viewport_size_;
+ frame_data->size = viewport_pixel_size_;
frame_data->damage_rect = damage_rect_;
}
« no previous file with comments | « cc/output/software_output_device.h ('k') | cc/test/pixel_test_software_output_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698