| 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 "ui/ozone/platform/headless/headless_surface_factory.h" | 5 #include "ui/ozone/platform/headless/headless_surface_factory.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "base/task_scheduler/post_task.h" | 12 #include "base/task_scheduler/post_task.h" |
| 13 #include "third_party/skia/include/core/SkCanvas.h" | 13 #include "third_party/skia/include/core/SkCanvas.h" |
| 14 #include "third_party/skia/include/core/SkSurface.h" | 14 #include "third_party/skia/include/core/SkSurface.h" |
| 15 #include "ui/gfx/codec/png_codec.h" | 15 #include "ui/gfx/codec/png_codec.h" |
| 16 #include "ui/gfx/native_pixmap.h" |
| 16 #include "ui/gfx/skia_util.h" | 17 #include "ui/gfx/skia_util.h" |
| 17 #include "ui/gfx/vsync_provider.h" | 18 #include "ui/gfx/vsync_provider.h" |
| 18 #include "ui/ozone/platform/headless/headless_window.h" | 19 #include "ui/ozone/platform/headless/headless_window.h" |
| 19 #include "ui/ozone/platform/headless/headless_window_manager.h" | 20 #include "ui/ozone/platform/headless/headless_window_manager.h" |
| 20 #include "ui/ozone/public/native_pixmap.h" | |
| 21 #include "ui/ozone/public/surface_ozone_canvas.h" | 21 #include "ui/ozone/public/surface_ozone_canvas.h" |
| 22 | 22 |
| 23 namespace ui { | 23 namespace ui { |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 void WriteDataToFile(const base::FilePath& location, const SkBitmap& bitmap) { | 27 void WriteDataToFile(const base::FilePath& location, const SkBitmap& bitmap) { |
| 28 DCHECK(!location.empty()); | 28 DCHECK(!location.empty()); |
| 29 std::vector<unsigned char> png_data; | 29 std::vector<unsigned char> png_data; |
| 30 gfx::PNGCodec::FastEncodeBGRASkBitmap(bitmap, true, &png_data); | 30 gfx::PNGCodec::FastEncodeBGRASkBitmap(bitmap, true, &png_data); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 scoped_refptr<NativePixmap> HeadlessSurfaceFactory::CreateNativePixmap( | 124 scoped_refptr<NativePixmap> HeadlessSurfaceFactory::CreateNativePixmap( |
| 125 gfx::AcceleratedWidget widget, | 125 gfx::AcceleratedWidget widget, |
| 126 gfx::Size size, | 126 gfx::Size size, |
| 127 gfx::BufferFormat format, | 127 gfx::BufferFormat format, |
| 128 gfx::BufferUsage usage) { | 128 gfx::BufferUsage usage) { |
| 129 return new TestPixmap(format); | 129 return new TestPixmap(format); |
| 130 } | 130 } |
| 131 | 131 |
| 132 } // namespace ui | 132 } // namespace ui |
| OLD | NEW |