| 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 "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 "cc/output/software_frame_data.h" | 8 #include "cc/output/software_frame_data.h" |
| 9 #include "third_party/skia/include/core/SkBitmapDevice.h" | 9 #include "third_party/skia/include/core/SkBitmapDevice.h" |
| 10 #include "third_party/skia/include/core/SkCanvas.h" | 10 #include "third_party/skia/include/core/SkCanvas.h" |
| 11 #include "ui/gfx/skia_util.h" | 11 #include "ui/gfx/skia_util.h" |
| 12 #include "ui/gfx/vsync_provider.h" | 12 #include "ui/gfx/vsync_provider.h" |
| 13 | 13 |
| 14 namespace cc { | 14 namespace cc { |
| 15 | 15 |
| 16 SoftwareOutputDevice::SoftwareOutputDevice() {} | 16 SoftwareOutputDevice::SoftwareOutputDevice() {} |
| 17 | 17 |
| 18 SoftwareOutputDevice::~SoftwareOutputDevice() {} | 18 SoftwareOutputDevice::~SoftwareOutputDevice() {} |
| 19 | 19 |
| 20 void SoftwareOutputDevice::Resize(const gfx::Size& viewport_size) { | 20 void SoftwareOutputDevice::Resize(gfx::Size viewport_size) { |
| 21 if (viewport_size_ == viewport_size) | 21 if (viewport_size_ == viewport_size) |
| 22 return; | 22 return; |
| 23 | 23 |
| 24 viewport_size_ = viewport_size; | 24 viewport_size_ = viewport_size; |
| 25 device_ = skia::AdoptRef(new SkBitmapDevice(SkBitmap::kARGB_8888_Config, | 25 device_ = skia::AdoptRef(new SkBitmapDevice(SkBitmap::kARGB_8888_Config, |
| 26 viewport_size.width(), viewport_size.height(), true)); | 26 viewport_size.width(), viewport_size.height(), true)); |
| 27 canvas_ = skia::AdoptRef(new SkCanvas(device_.get())); | 27 canvas_ = skia::AdoptRef(new SkCanvas(device_.get())); |
| 28 } | 28 } |
| 29 | 29 |
| 30 SkCanvas* SoftwareOutputDevice::BeginPaint(const gfx::Rect& damage_rect) { | 30 SkCanvas* SoftwareOutputDevice::BeginPaint(const gfx::Rect& damage_rect) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 55 | 55 |
| 56 void SoftwareOutputDevice::ReclaimSoftwareFrame(unsigned id) { | 56 void SoftwareOutputDevice::ReclaimSoftwareFrame(unsigned id) { |
| 57 NOTIMPLEMENTED(); | 57 NOTIMPLEMENTED(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 gfx::VSyncProvider* SoftwareOutputDevice::GetVSyncProvider() { | 60 gfx::VSyncProvider* SoftwareOutputDevice::GetVSyncProvider() { |
| 61 return vsync_provider_.get(); | 61 return vsync_provider_.get(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 } // namespace cc | 64 } // namespace cc |
| OLD | NEW |