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

Side by Side Diff: ui/ozone/platform/wayland/wayland_surface_factory.cc

Issue 1673063002: ozone/platform/wayland: Add some tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use two WaitableEvents to prevent race, re-arrange some definitions, other minor test robustness fi… Created 4 years, 10 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/wayland/wayland_surface_factory.h" 5 #include "ui/ozone/platform/wayland/wayland_surface_factory.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <sys/mman.h> 8 #include <sys/mman.h>
9 9
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 29 matching lines...) Expand all
40 gfx::Size size_; 40 gfx::Size size_;
41 skia::RefPtr<SkSurface> sk_surface_; 41 skia::RefPtr<SkSurface> sk_surface_;
42 wl::Object<wl_shm_pool> pool_; 42 wl::Object<wl_shm_pool> pool_;
43 wl::Object<wl_buffer> buffer_; 43 wl::Object<wl_buffer> buffer_;
44 44
45 DISALLOW_COPY_AND_ASSIGN(WaylandCanvasSurface); 45 DISALLOW_COPY_AND_ASSIGN(WaylandCanvasSurface);
46 }; 46 };
47 47
48 WaylandCanvasSurface::WaylandCanvasSurface(WaylandDisplay* display, 48 WaylandCanvasSurface::WaylandCanvasSurface(WaylandDisplay* display,
49 WaylandWindow* window) 49 WaylandWindow* window)
50 : display_(display), window_(window) {} 50 : display_(display), window_(window), size_(window->GetBounds().size()) {}
51 51
52 WaylandCanvasSurface::~WaylandCanvasSurface() {} 52 WaylandCanvasSurface::~WaylandCanvasSurface() {}
53 53
54 skia::RefPtr<SkSurface> WaylandCanvasSurface::GetSurface() { 54 skia::RefPtr<SkSurface> WaylandCanvasSurface::GetSurface() {
55 if (sk_surface_) 55 if (sk_surface_)
56 return sk_surface_; 56 return sk_surface_;
57 57
58 size_t length = size_.width() * size_.height() * 4; 58 size_t length = size_.width() * size_.height() * 4;
59 auto shared_memory = make_scoped_ptr(new base::SharedMemory); 59 auto shared_memory = make_scoped_ptr(new base::SharedMemory);
60 if (!shared_memory->CreateAndMapAnonymous(length)) 60 if (!shared_memory->CreateAndMapAnonymous(length))
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 return nullptr; 164 return nullptr;
165 } 165 }
166 166
167 scoped_refptr<NativePixmap> WaylandSurfaceFactory::CreateNativePixmapFromHandle( 167 scoped_refptr<NativePixmap> WaylandSurfaceFactory::CreateNativePixmapFromHandle(
168 const gfx::NativePixmapHandle& handle) { 168 const gfx::NativePixmapHandle& handle) {
169 NOTIMPLEMENTED(); 169 NOTIMPLEMENTED();
170 return nullptr; 170 return nullptr;
171 } 171 }
172 172
173 } // namespace ui 173 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/wayland/wayland_surface_factory.h ('k') | ui/ozone/platform/wayland/wayland_surface_factory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698