| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "components/exo/wayland/clients/client_base.h" | 5 #include "components/exo/wayland/clients/client_base.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <linux-dmabuf-unstable-v1-client-protocol.h> | 8 #include <linux-dmabuf-unstable-v1-client-protocol.h> |
| 9 #include <presentation-time-client-protocol.h> | 9 #include <presentation-time-client-protocol.h> |
| 10 #include <wayland-client-core.h> | 10 #include <wayland-client-core.h> |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 } | 262 } |
| 263 } | 263 } |
| 264 | 264 |
| 265 if (drm_fd_.get() < 0) { | 265 if (drm_fd_.get() < 0) { |
| 266 LOG_IF(ERROR, params.use_drm) | 266 LOG_IF(ERROR, params.use_drm) |
| 267 << "Can't find drm device: '" << params.use_drm_value << "'"; | 267 << "Can't find drm device: '" << params.use_drm_value << "'"; |
| 268 LOG_IF(ERROR, !params.use_drm) << "Can't find drm device"; | 268 LOG_IF(ERROR, !params.use_drm) << "Can't find drm device"; |
| 269 return false; | 269 return false; |
| 270 } | 270 } |
| 271 | 271 |
| 272 zwp_linux_dmabuf_v1_add_listener(globals_.linux_dmabuf.get(), |
| 273 ¶ms.dmabuf_listener, &globals_); |
| 274 |
| 272 device_.reset(gbm_create_device(drm_fd_.get())); | 275 device_.reset(gbm_create_device(drm_fd_.get())); |
| 273 if (!device_) { | 276 if (!device_) { |
| 274 LOG(ERROR) << "Can't create gbm device"; | 277 LOG(ERROR) << "Can't create gbm device"; |
| 275 return false; | 278 return false; |
| 276 } | 279 } |
| 277 | 280 |
| 278 ui::OzonePlatform::InitParams params; | 281 ui::OzonePlatform::InitParams params; |
| 279 params.single_process = true; | 282 params.single_process = true; |
| 280 ui::OzonePlatform::InitializeForGPU(params); | 283 ui::OzonePlatform::InitializeForGPU(params); |
| 281 bool gl_initialized = gl::init::InitializeGLOneOff(); | 284 bool gl_initialized = gl::init::InitializeGLOneOff(); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 buffer->sk_surface = SkSurface::MakeRasterDirect( | 467 buffer->sk_surface = SkSurface::MakeRasterDirect( |
| 465 SkImageInfo::Make(width_, height_, kColorType, kOpaque_SkAlphaType), | 468 SkImageInfo::Make(width_, height_, kColorType, kOpaque_SkAlphaType), |
| 466 static_cast<uint8_t*>(buffer->shared_memory->memory()), stride); | 469 static_cast<uint8_t*>(buffer->shared_memory->memory()), stride); |
| 467 DCHECK(buffer->sk_surface); | 470 DCHECK(buffer->sk_surface); |
| 468 return buffer; | 471 return buffer; |
| 469 } | 472 } |
| 470 | 473 |
| 471 } // namespace clients | 474 } // namespace clients |
| 472 } // namespace wayland | 475 } // namespace wayland |
| 473 } // namespace exo | 476 } // namespace exo |
| OLD | NEW |