OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/browser/compositor/software_output_device_mus.h" | 5 #include "content/browser/compositor/software_output_device_mus.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> |
8 | 9 |
9 #include "components/bitmap_uploader/bitmap_uploader.h" | 10 #include "components/bitmap_uploader/bitmap_uploader.h" |
10 #include "third_party/skia/include/core/SkImageInfo.h" | 11 #include "third_party/skia/include/core/SkImageInfo.h" |
11 #include "ui/base/view_prop.h" | 12 #include "ui/base/view_prop.h" |
12 #include "ui/compositor/compositor.h" | 13 #include "ui/compositor/compositor.h" |
13 #include "ui/gfx/skia_util.h" | 14 #include "ui/gfx/skia_util.h" |
14 | 15 |
15 #if !defined(OFFICIAL_BUILD) | 16 #if !defined(OFFICIAL_BUILD) |
16 #include "base/threading/thread_restrictions.h" | 17 #include "base/threading/thread_restrictions.h" |
17 #endif | 18 #endif |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 return; | 52 return; |
52 } | 53 } |
53 | 54 |
54 const unsigned char* pixels = static_cast<const unsigned char*>(addr); | 55 const unsigned char* pixels = static_cast<const unsigned char*>(addr); |
55 | 56 |
56 // TODO(rjkroege): This makes an additional copy. Improve the | 57 // TODO(rjkroege): This makes an additional copy. Improve the |
57 // bitmap_uploader API to remove. | 58 // bitmap_uploader API to remove. |
58 scoped_ptr<std::vector<unsigned char>> data(new std::vector<unsigned char>( | 59 scoped_ptr<std::vector<unsigned char>> data(new std::vector<unsigned char>( |
59 pixels, pixels + rowBytes * viewport_pixel_size_.height())); | 60 pixels, pixels + rowBytes * viewport_pixel_size_.height())); |
60 uploader->SetBitmap(viewport_pixel_size_.width(), | 61 uploader->SetBitmap(viewport_pixel_size_.width(), |
61 viewport_pixel_size_.height(), data.Pass(), | 62 viewport_pixel_size_.height(), std::move(data), |
62 bitmap_uploader::BitmapUploader::BGRA); | 63 bitmap_uploader::BitmapUploader::BGRA); |
63 } | 64 } |
64 | 65 |
65 } // namespace content | 66 } // namespace content |
OLD | NEW |