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

Side by Side Diff: components/exo/wayland/clients/client_base.cc

Issue 2864483007: gpu: Use ANDROID_native_fence_sync instead of ARM_implicit_external_sync.
Patch Set: EGL_KHR_fence_sync DCHECK Created 3 years, 7 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 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 bool gl_initialized = gl::init::InitializeGLOneOff(); 281 bool gl_initialized = gl::init::InitializeGLOneOff();
282 DCHECK(gl_initialized); 282 DCHECK(gl_initialized);
283 gl_surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size()); 283 gl_surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size());
284 gl_context_ = 284 gl_context_ =
285 gl::init::CreateGLContext(nullptr, // share_group 285 gl::init::CreateGLContext(nullptr, // share_group
286 gl_surface_.get(), gl::GLContextAttribs()); 286 gl_surface_.get(), gl::GLContextAttribs());
287 287
288 make_current_.reset( 288 make_current_.reset(
289 new ui::ScopedMakeCurrent(gl_context_.get(), gl_surface_.get())); 289 new ui::ScopedMakeCurrent(gl_context_.get(), gl_surface_.get()));
290 290
291 if (gl::GLSurfaceEGL::HasEGLExtension("EGL_EXT_image_flush_external") || 291 DCHECK(gl::GLSurfaceEGL::HasEGLExtension("EGL_KHR_fence_sync"));
292 gl::GLSurfaceEGL::HasEGLExtension("EGL_ARM_implicit_external_sync")) {
293 egl_sync_type_ = EGL_SYNC_FENCE_KHR;
294 }
295 if (gl::GLSurfaceEGL::HasEGLExtension("EGL_ANDROID_native_fence_sync")) { 292 if (gl::GLSurfaceEGL::HasEGLExtension("EGL_ANDROID_native_fence_sync")) {
296 egl_sync_type_ = EGL_SYNC_NATIVE_FENCE_ANDROID; 293 egl_sync_type_ = EGL_SYNC_NATIVE_FENCE_ANDROID;
294 } else {
295 egl_sync_type_ = EGL_SYNC_FENCE_KHR;
297 } 296 }
298 297
299 native_interface = sk_sp<const GrGLInterface>(GrGLCreateNativeInterface()); 298 native_interface = sk_sp<const GrGLInterface>(GrGLCreateNativeInterface());
300 DCHECK(native_interface); 299 DCHECK(native_interface);
301 gr_context_ = sk_sp<GrContext>(GrContext::Create( 300 gr_context_ = sk_sp<GrContext>(GrContext::Create(
302 kOpenGL_GrBackend, 301 kOpenGL_GrBackend,
303 reinterpret_cast<GrBackendContext>(native_interface.get()))); 302 reinterpret_cast<GrBackendContext>(native_interface.get())));
304 DCHECK(gr_context_); 303 DCHECK(gr_context_);
305 } 304 }
306 #endif 305 #endif
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 buffer->sk_surface = SkSurface::MakeRasterDirect( 463 buffer->sk_surface = SkSurface::MakeRasterDirect(
465 SkImageInfo::Make(width_, height_, kColorType, kOpaque_SkAlphaType), 464 SkImageInfo::Make(width_, height_, kColorType, kOpaque_SkAlphaType),
466 static_cast<uint8_t*>(buffer->shared_memory->memory()), stride); 465 static_cast<uint8_t*>(buffer->shared_memory->memory()), stride);
467 DCHECK(buffer->sk_surface); 466 DCHECK(buffer->sk_surface);
468 return buffer; 467 return buffer;
469 } 468 }
470 469
471 } // namespace clients 470 } // namespace clients
472 } // namespace wayland 471 } // namespace wayland
473 } // namespace exo 472 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698