OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "remoting/host/chromeos/aura_desktop_capturer.h" | 5 #include "remoting/host/chromeos/aura_desktop_capturer.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "cc/output/copy_output_request.h" | 9 #include "cc/output/copy_output_request.h" |
10 #include "cc/output/copy_output_result.h" | 10 #include "cc/output/copy_output_result.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 scoped_ptr<SkBitmap> bitmap_; | 33 scoped_ptr<SkBitmap> bitmap_; |
34 | 34 |
35 DISALLOW_COPY_AND_ASSIGN(SkiaBitmapDesktopFrame); | 35 DISALLOW_COPY_AND_ASSIGN(SkiaBitmapDesktopFrame); |
36 }; | 36 }; |
37 | 37 |
38 // static | 38 // static |
39 SkiaBitmapDesktopFrame* SkiaBitmapDesktopFrame::Create( | 39 SkiaBitmapDesktopFrame* SkiaBitmapDesktopFrame::Create( |
40 scoped_ptr<SkBitmap> bitmap) { | 40 scoped_ptr<SkBitmap> bitmap) { |
41 | 41 |
42 webrtc::DesktopSize size(bitmap->width(), bitmap->height()); | 42 webrtc::DesktopSize size(bitmap->width(), bitmap->height()); |
43 DCHECK_EQ(kRGBA_8888_SkColorType, bitmap->info().colorType()) | 43 DCHECK_EQ(kBGRA_8888_SkColorType, bitmap->info().colorType()) |
44 << "DesktopFrame objects always hold RGBA data."; | 44 << "DesktopFrame objects always hold BGRA data."; |
45 | 45 |
46 uint8_t* bitmap_data = reinterpret_cast<uint8_t*>(bitmap->getPixels()); | 46 uint8_t* bitmap_data = reinterpret_cast<uint8_t*>(bitmap->getPixels()); |
47 | 47 |
48 SkiaBitmapDesktopFrame* result = new SkiaBitmapDesktopFrame( | 48 SkiaBitmapDesktopFrame* result = new SkiaBitmapDesktopFrame( |
49 size, bitmap->rowBytes(), bitmap_data, bitmap.Pass()); | 49 size, bitmap->rowBytes(), bitmap_data, bitmap.Pass()); |
50 | 50 |
51 return result; | 51 return result; |
52 } | 52 } |
53 | 53 |
54 SkiaBitmapDesktopFrame::SkiaBitmapDesktopFrame(webrtc::DesktopSize size, | 54 SkiaBitmapDesktopFrame::SkiaBitmapDesktopFrame(webrtc::DesktopSize size, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
109 const webrtc::DesktopRect& rect = webrtc::DesktopRect::MakeWH( | 109 const webrtc::DesktopRect& rect = webrtc::DesktopRect::MakeWH( |
110 frame->size().width(), frame->size().height()); | 110 frame->size().width(), frame->size().height()); |
111 | 111 |
112 // TODO(kelvinp): Set Frame DPI according to the screen resolution. | 112 // TODO(kelvinp): Set Frame DPI according to the screen resolution. |
113 // See cc::Layer::contents_scale_(x|y)() and frame->set_depi(). | 113 // See cc::Layer::contents_scale_(x|y)() and frame->set_depi(). |
114 frame->mutable_updated_region()->SetRect(rect); | 114 frame->mutable_updated_region()->SetRect(rect); |
115 | 115 |
116 callback_->OnCaptureCompleted(frame.release()); | 116 callback_->OnCaptureCompleted(frame.release()); |
117 } | 117 } |
118 | 118 |
119 bool AuraDesktopCapturer::GetScreenList(ScreenList* screens) { | |
Wez
2014/10/17 17:57:59
Do you ever intend to implement these? If so then
kelvinp
2014/10/20 00:21:16
No plans for supporting multiple desktop on Chrome
Wez
2014/10/24 00:28:47
OK; as discussed let's revert this and take the hi
| |
120 NOTIMPLEMENTED(); | |
121 return false; | |
122 } | |
123 | |
124 bool AuraDesktopCapturer::SelectScreen(webrtc::ScreenId id) { | |
125 NOTIMPLEMENTED(); | |
126 return false; | |
127 }; | |
128 | |
119 } // namespace remoting | 129 } // namespace remoting |
130 | |
131 namespace webrtc { | |
Wez
2014/10/17 17:57:59
nit: Blank line between namespace and //static lin
kelvinp
2014/10/20 00:21:16
Done.
| |
132 // static | |
133 ScreenCapturer* ScreenCapturer::Create(const DesktopCaptureOptions& options) { | |
134 return new remoting::AuraDesktopCapturer(); | |
135 } | |
136 | |
137 } // namespace webrtc | |
OLD | NEW |