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