Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Side by Side Diff: ui/ozone/platform/headless/headless_surface_factory.cc

Issue 2768343002: Change namespace from ui to gfx for NativePixmap related code (Closed)
Patch Set: Addressed sadrul's remark Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 std::unique_ptr<gfx::VSyncProvider> CreateVSyncProvider() override { 65 std::unique_ptr<gfx::VSyncProvider> CreateVSyncProvider() override {
66 return nullptr; 66 return nullptr;
67 } 67 }
68 68
69 private: 69 private:
70 base::FilePath location_; 70 base::FilePath location_;
71 sk_sp<SkSurface> surface_; 71 sk_sp<SkSurface> surface_;
72 }; 72 };
73 73
74 class TestPixmap : public ui::NativePixmap { 74 class TestPixmap : public gfx::NativePixmap {
75 public: 75 public:
76 explicit TestPixmap(gfx::BufferFormat format) : format_(format) {} 76 explicit TestPixmap(gfx::BufferFormat format) : format_(format) {}
77 77
78 void* GetEGLClientBuffer() const override { return nullptr; } 78 void* GetEGLClientBuffer() const override { return nullptr; }
79 bool AreDmaBufFdsValid() const override { return false; } 79 bool AreDmaBufFdsValid() const override { return false; }
80 size_t GetDmaBufFdCount() const override { return 0; } 80 size_t GetDmaBufFdCount() const override { return 0; }
81 int GetDmaBufFd(size_t plane) const override { return -1; } 81 int GetDmaBufFd(size_t plane) const override { return -1; }
82 int GetDmaBufPitch(size_t plane) const override { return 0; } 82 int GetDmaBufPitch(size_t plane) const override { return 0; }
83 int GetDmaBufOffset(size_t plane) const override { return 0; } 83 int GetDmaBufOffset(size_t plane) const override { return 0; }
84 uint64_t GetDmaBufModifier(size_t plane) const override { return 0; } 84 uint64_t GetDmaBufModifier(size_t plane) const override { return 0; }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 return nullptr; 131 return nullptr;
132 } 132 }
133 } 133 }
134 134
135 std::unique_ptr<SurfaceOzoneCanvas> 135 std::unique_ptr<SurfaceOzoneCanvas>
136 HeadlessSurfaceFactory::CreateCanvasForWidget(gfx::AcceleratedWidget widget) { 136 HeadlessSurfaceFactory::CreateCanvasForWidget(gfx::AcceleratedWidget widget) {
137 HeadlessWindow* window = window_manager_->GetWindow(widget); 137 HeadlessWindow* window = window_manager_->GetWindow(widget);
138 return base::WrapUnique<SurfaceOzoneCanvas>(new FileSurface(window->path())); 138 return base::WrapUnique<SurfaceOzoneCanvas>(new FileSurface(window->path()));
139 } 139 }
140 140
141 scoped_refptr<NativePixmap> HeadlessSurfaceFactory::CreateNativePixmap( 141 scoped_refptr<gfx::NativePixmap> HeadlessSurfaceFactory::CreateNativePixmap(
142 gfx::AcceleratedWidget widget, 142 gfx::AcceleratedWidget widget,
143 gfx::Size size, 143 gfx::Size size,
144 gfx::BufferFormat format, 144 gfx::BufferFormat format,
145 gfx::BufferUsage usage) { 145 gfx::BufferUsage usage) {
146 return new TestPixmap(format); 146 return new TestPixmap(format);
147 } 147 }
148 148
149 } // namespace ui 149 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698