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()) |
rmsousa
2014/10/14 00:18:25
Out of curiosity: was this broken before? Are we t
kelvinp
2014/10/15 23:03:09
Yes, I created this file two weeks ago but it is n
| |
44 << "DesktopFrame objects always hold RGBA data."; | 44 << "DesktopFrame objects always hold BGRA data."; |
Jamie
2014/10/14 01:18:41
There seem to be a couple of changes that flip the
kelvinp
2014/10/15 23:03:09
This is required otherwise the DCHECK will fail af
| |
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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 } // namespace remoting | 119 } // namespace remoting |
OLD | NEW |