| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "cc/output/copy_output_request.h" | 8 #include "cc/output/copy_output_request.h" |
| 9 #include "cc/output/copy_output_result.h" | 9 #include "cc/output/copy_output_result.h" |
| 10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 scoped_ptr<SkBitmap> bitmap_; | 36 scoped_ptr<SkBitmap> bitmap_; |
| 37 | 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(SkiaBitmapDesktopFrame); | 38 DISALLOW_COPY_AND_ASSIGN(SkiaBitmapDesktopFrame); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 // static | 41 // static |
| 42 SkiaBitmapDesktopFrame* SkiaBitmapDesktopFrame::Create( | 42 SkiaBitmapDesktopFrame* SkiaBitmapDesktopFrame::Create( |
| 43 scoped_ptr<SkBitmap> bitmap) { | 43 scoped_ptr<SkBitmap> bitmap) { |
| 44 | 44 |
| 45 webrtc::DesktopSize size(bitmap->width(), bitmap->height()); | 45 webrtc::DesktopSize size(bitmap->width(), bitmap->height()); |
| 46 DCHECK_EQ(kBGRA_8888_SkColorType, bitmap->info().colorType()) | 46 DCHECK_EQ(kRGBA_8888_SkColorType, bitmap->info().colorType()) |
| 47 << "DesktopFrame objects always hold RGBA data."; | 47 << "DesktopFrame objects always hold RGBA data."; |
| 48 | 48 |
| 49 uint8_t* bitmap_data = reinterpret_cast<uint8_t*>(bitmap->getPixels()); | 49 uint8_t* bitmap_data = reinterpret_cast<uint8_t*>(bitmap->getPixels()); |
| 50 | 50 |
| 51 SkiaBitmapDesktopFrame* result = new SkiaBitmapDesktopFrame( | 51 SkiaBitmapDesktopFrame* result = new SkiaBitmapDesktopFrame( |
| 52 size, bitmap->rowBytes(), bitmap_data, bitmap.Pass()); | 52 size, bitmap->rowBytes(), bitmap_data, bitmap.Pass()); |
| 53 | 53 |
| 54 return result; | 54 return result; |
| 55 } | 55 } |
| 56 | 56 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 frame->size().width(), frame->size().height()); | 115 frame->size().width(), frame->size().height()); |
| 116 | 116 |
| 117 // TODO(kelvinp): Set Frame DPI according to the screen resolution. | 117 // TODO(kelvinp): Set Frame DPI according to the screen resolution. |
| 118 // See cc::Layer::contents_scale_(x|y)() and frame->set_depi(). | 118 // See cc::Layer::contents_scale_(x|y)() and frame->set_depi(). |
| 119 frame->mutable_updated_region()->SetRect(rect); | 119 frame->mutable_updated_region()->SetRect(rect); |
| 120 | 120 |
| 121 callback_->OnCaptureCompleted(frame.release()); | 121 callback_->OnCaptureCompleted(frame.release()); |
| 122 } | 122 } |
| 123 | 123 |
| 124 } // namespace remoting | 124 } // namespace remoting |
| OLD | NEW |