| 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/cast/surface_factory_cast.h" | 5 #include "ui/ozone/platform/cast/surface_factory_cast.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 std::unique_ptr<gfx::VSyncProvider> CreateVSyncProvider() override { | 38 std::unique_ptr<gfx::VSyncProvider> CreateVSyncProvider() override { |
| 39 return nullptr; | 39 return nullptr; |
| 40 } | 40 } |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 sk_sp<SkSurface> surface_; | 43 sk_sp<SkSurface> surface_; |
| 44 | 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(DummySurface); | 45 DISALLOW_COPY_AND_ASSIGN(DummySurface); |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 class CastPixmap : public NativePixmap { | 48 class CastPixmap : public gfx::NativePixmap { |
| 49 public: | 49 public: |
| 50 explicit CastPixmap(GLOzoneEglCast* parent) : parent_(parent) {} | 50 explicit CastPixmap(GLOzoneEglCast* parent) : parent_(parent) {} |
| 51 | 51 |
| 52 void* GetEGLClientBuffer() const override { | 52 void* GetEGLClientBuffer() const override { |
| 53 // TODO(halliwell): try to implement this through CastEglPlatform. | 53 // TODO(halliwell): try to implement this through CastEglPlatform. |
| 54 return nullptr; | 54 return nullptr; |
| 55 } | 55 } |
| 56 bool AreDmaBufFdsValid() const override { return false; } | 56 bool AreDmaBufFdsValid() const override { return false; } |
| 57 size_t GetDmaBufFdCount() const override { return 0; } | 57 size_t GetDmaBufFdCount() const override { return 0; } |
| 58 int GetDmaBufFd(size_t plane) const override { return -1; } | 58 int GetDmaBufFd(size_t plane) const override { return -1; } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 } | 122 } |
| 123 | 123 |
| 124 std::unique_ptr<SurfaceOzoneCanvas> SurfaceFactoryCast::CreateCanvasForWidget( | 124 std::unique_ptr<SurfaceOzoneCanvas> SurfaceFactoryCast::CreateCanvasForWidget( |
| 125 gfx::AcceleratedWidget widget) { | 125 gfx::AcceleratedWidget widget) { |
| 126 // Software canvas support only in headless mode | 126 // Software canvas support only in headless mode |
| 127 if (egl_implementation_) | 127 if (egl_implementation_) |
| 128 return nullptr; | 128 return nullptr; |
| 129 return base::WrapUnique<SurfaceOzoneCanvas>(new DummySurface()); | 129 return base::WrapUnique<SurfaceOzoneCanvas>(new DummySurface()); |
| 130 } | 130 } |
| 131 | 131 |
| 132 scoped_refptr<NativePixmap> SurfaceFactoryCast::CreateNativePixmap( | 132 scoped_refptr<gfx::NativePixmap> SurfaceFactoryCast::CreateNativePixmap( |
| 133 gfx::AcceleratedWidget widget, | 133 gfx::AcceleratedWidget widget, |
| 134 gfx::Size size, | 134 gfx::Size size, |
| 135 gfx::BufferFormat format, | 135 gfx::BufferFormat format, |
| 136 gfx::BufferUsage usage) { | 136 gfx::BufferUsage usage) { |
| 137 return make_scoped_refptr(new CastPixmap(egl_implementation_.get())); | 137 return make_scoped_refptr(new CastPixmap(egl_implementation_.get())); |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace ui | 140 } // namespace ui |
| OLD | NEW |