Skip to content

Commit

Permalink
gpu_init: Stop inlining GpuInit::TakeDefaultOffscreenSurface()
Browse files Browse the repository at this point in the history
This fixes the GCC build after commit b6ef3ba ("Pass GpuPreferences to
in-process GPU in Mash"):

    In file included from ../../content/utility/utility_service_factory.h:12,
                     from ../../content/utility/utility_service_factory.cc:5:
    ../../base/memory/scoped_refptr.h: In instantiation of ‘static void scoped_refptr<T>::Release(T*) [with T = gl::GLSurface]’:
    ../../base/memory/scoped_refptr.h:208:14:   required from ‘scoped_refptr<T>::~scoped_refptr() [with T = gl::GLSurface]’
    ../../gpu/ipc/service/gpu_init.h:70:48:   required from here
    ../../base/memory/scoped_refptr.h:284:8: error: invalid use of incomplete type ‘class gl::GLSurface’
       ptr->Release();
       ~~~~~^~~~~~~
    In file included from ../../services/viz/service.h:8,
                     from ../../content/utility/utility_service_factory.cc:35:
    ../../gpu/ipc/service/gpu_init.h:22:7: note: forward declaration of ‘class gl::GLSurface’
     class GLSurface;
           ^~~~~~~~~

gpu_init.h forward-declares gl::GLSurface but using std::move() with GCC
seems to require a full declaration for things to work.

Bug: 819294
Change-Id: Ib22ca2f8af6977869571292acf780042507a8afd
Reviewed-on: https://chromium-review.googlesource.com/c/1365249
Reviewed-by: Jonathan Backer <backer@chromium.org>
Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/master@{#614358}
  • Loading branch information
Raphael Kubo da Costa authored and Commit Bot committed Dec 6, 2018
1 parent d6f9ac5 commit 763b79a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions gpu/ipc/service/gpu_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -519,4 +519,8 @@ void GpuInit::AdjustInfoToSwiftShader() {
CollectContextGraphicsInfo(&gpu_info_, gpu_preferences_);
}

scoped_refptr<gl::GLSurface> GpuInit::TakeDefaultOffscreenSurface() {
return std::move(default_offscreen_surface_);
}

} // namespace gpu
4 changes: 1 addition & 3 deletions gpu/ipc/service/gpu_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ class GPU_IPC_SERVICE_EXPORT GpuInit {
std::unique_ptr<GpuWatchdogThread> TakeWatchdogThread() {
return std::move(watchdog_thread_);
}
scoped_refptr<gl::GLSurface> TakeDefaultOffscreenSurface() {
return std::move(default_offscreen_surface_);
}
scoped_refptr<gl::GLSurface> TakeDefaultOffscreenSurface();
bool init_successful() const { return init_successful_; }
#if BUILDFLAG(ENABLE_VULKAN)
VulkanImplementation* vulkan_implementation() {
Expand Down

0 comments on commit 763b79a

Please sign in to comment.