| 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/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
| 10 #include "third_party/skia/include/core/SkDevice.h" | 10 #include "third_party/skia/include/core/SkDevice.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 SkCanvas* SoftwareOutputDevice::BeginPaint(gfx::Rect damage_rect) { | 29 SkCanvas* SoftwareOutputDevice::BeginPaint(gfx::Rect damage_rect) { |
| 30 DCHECK(device_); | 30 DCHECK(device_); |
| 31 damage_rect_ = damage_rect; | 31 damage_rect_ = damage_rect; |
| 32 return canvas_.get(); | 32 return canvas_.get(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void SoftwareOutputDevice::EndPaint(SoftwareFrameData* frame_data) { | 35 void SoftwareOutputDevice::EndPaint(SoftwareFrameData* frame_data) { |
| 36 DCHECK(device_); | 36 DCHECK(device_); |
| 37 if (frame_data) { | 37 if (frame_data) { |
| 38 frame_data->id = 0; |
| 38 frame_data->size = viewport_size_; | 39 frame_data->size = viewport_size_; |
| 39 frame_data->damage_rect = damage_rect_; | 40 frame_data->damage_rect = damage_rect_; |
| 40 frame_data->dib_id = TransportDIB::Id(); | 41 frame_data->handle = base::SharedMemory::NULLHandle(); |
| 41 } | 42 } |
| 42 } | 43 } |
| 43 | 44 |
| 44 void SoftwareOutputDevice::CopyToBitmap( | 45 void SoftwareOutputDevice::CopyToBitmap( |
| 45 gfx::Rect rect, SkBitmap* output) { | 46 gfx::Rect rect, SkBitmap* output) { |
| 46 DCHECK(device_); | 47 DCHECK(device_); |
| 47 const SkBitmap& bitmap = device_->accessBitmap(false); | 48 const SkBitmap& bitmap = device_->accessBitmap(false); |
| 48 bitmap.extractSubset(output, gfx::RectToSkIRect(rect)); | 49 bitmap.extractSubset(output, gfx::RectToSkIRect(rect)); |
| 49 } | 50 } |
| 50 | 51 |
| 51 void SoftwareOutputDevice::Scroll( | 52 void SoftwareOutputDevice::Scroll( |
| 52 gfx::Vector2d delta, gfx::Rect clip_rect) { | 53 gfx::Vector2d delta, gfx::Rect clip_rect) { |
| 53 NOTIMPLEMENTED(); | 54 NOTIMPLEMENTED(); |
| 54 } | 55 } |
| 55 | 56 |
| 56 void SoftwareOutputDevice::ReclaimDIB(const TransportDIB::Id& id) { | 57 void SoftwareOutputDevice::ReclaimSoftwareFrame(unsigned id) { |
| 57 NOTIMPLEMENTED(); | 58 NOTIMPLEMENTED(); |
| 58 } | 59 } |
| 59 | 60 |
| 60 } // namespace cc | 61 } // namespace cc |
| OLD | NEW |