| 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" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 base::FilePath location_; | 65 base::FilePath location_; |
| 66 sk_sp<SkSurface> surface_; | 66 sk_sp<SkSurface> surface_; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 class TestPixmap : public ui::NativePixmap { | 69 class TestPixmap : public ui::NativePixmap { |
| 70 public: | 70 public: |
| 71 TestPixmap(gfx::BufferFormat format) : format_(format) {} | 71 TestPixmap(gfx::BufferFormat format) : format_(format) {} |
| 72 | 72 |
| 73 void* GetEGLClientBuffer() const override { return nullptr; } | 73 void* GetEGLClientBuffer() const override { return nullptr; } |
| 74 bool AreDmaBufFdsValid() const override { return false; } | 74 bool AreDmaBufFdsValid() const override { return false; } |
| 75 size_t GetDmaBufFdCount() const override { return 0; } |
| 75 int GetDmaBufFd(size_t plane) const override { return -1; } | 76 int GetDmaBufFd(size_t plane) const override { return -1; } |
| 76 int GetDmaBufPitch(size_t plane) const override { return 0; } | 77 int GetDmaBufPitch(size_t plane) const override { return 0; } |
| 77 int GetDmaBufOffset(size_t plane) const override { return 0; } | 78 int GetDmaBufOffset(size_t plane) const override { return 0; } |
| 78 gfx::BufferFormat GetBufferFormat() const override { return format_; } | 79 gfx::BufferFormat GetBufferFormat() const override { return format_; } |
| 79 gfx::Size GetBufferSize() const override { return gfx::Size(); } | 80 gfx::Size GetBufferSize() const override { return gfx::Size(); } |
| 80 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | 81 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
| 81 int plane_z_order, | 82 int plane_z_order, |
| 82 gfx::OverlayTransform plane_transform, | 83 gfx::OverlayTransform plane_transform, |
| 83 const gfx::Rect& display_bounds, | 84 const gfx::Rect& display_bounds, |
| 84 const gfx::RectF& crop_rect) override { | 85 const gfx::RectF& crop_rect) override { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 124 |
| 124 scoped_refptr<NativePixmap> HeadlessSurfaceFactory::CreateNativePixmap( | 125 scoped_refptr<NativePixmap> HeadlessSurfaceFactory::CreateNativePixmap( |
| 125 gfx::AcceleratedWidget widget, | 126 gfx::AcceleratedWidget widget, |
| 126 gfx::Size size, | 127 gfx::Size size, |
| 127 gfx::BufferFormat format, | 128 gfx::BufferFormat format, |
| 128 gfx::BufferUsage usage) { | 129 gfx::BufferUsage usage) { |
| 129 return new TestPixmap(format); | 130 return new TestPixmap(format); |
| 130 } | 131 } |
| 131 | 132 |
| 132 } // namespace ui | 133 } // namespace ui |
| OLD | NEW |