Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No type named MakeGL in GrDirectContext (or GrContext) #4

Closed
acmlira opened this issue Nov 6, 2020 · 0 comments
Closed

No type named MakeGL in GrDirectContext (or GrContext) #4

acmlira opened this issue Nov 6, 2020 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@acmlira
Copy link
Owner

acmlira commented Nov 6, 2020

Android SDK NDK CMake skia SDL
30 21 10 chrome/m87 2.0.12

During the compilation of the application I realized that GrDirectContext and GrContext hasn't type named MakeGL. The skia build flags were these:

skia_use_system_libjpeg_turbo = false
skia_use_system_libwebp = false
skia_use_system_expat = false
skia_use_system_libpng = false
skia_use_system_freetype2 = false
ndk="/home/allan/Android/Sdk/ndk/21.3.6528147"
target_os="android" 
target_cpu="arm"
is_debug=false
is_component_build=true
extra_cflags=["-O3"]
skia_use_angle = false
skia_use_icu = false
skia_use_lua = false
skia_use_opencl = false
skia_use_piex = false
skia_use_zlib = false
skia_enable_tools = false
skia_enable_pdf = false
skia_use_gl = true
skia_enable_skottie = false

This was the error log:

../../../../../../../../sources/main.cpp:203:55: error: no type named 'MakeGL' in 'GrDirectContext'
      sk_sp<GrDirectContext> grContext(GrDirectContext::MakeGL(interface));
                                       ~~~~~~~~~~~~~~~~~^
../../../../../../../../sources/main.cpp:203:37: warning: parentheses were disambiguated as a function declaration [-Wvexing-parse]
      sk_sp<GrDirectContext> grContext(GrDirectContext::MakeGL(interface));
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../../sources/main.cpp:203:38: note: add a pair of parentheses to declare a variable
      sk_sp<GrDirectContext> grContext(GrDirectContext::MakeGL(interface));
                                       ^
                                       (
1 warning and 1 error generated.
[2/49] Building CXX object externals/skia/out/cmake/CMakeFiles/skia.dir/__/__/src/core/SkDeferredDisplayList.cpp.o

Let's see the skia code snippet:

#ifdef SK_GL
    /**
     * Creates a GrDirectContext for a backend context. If no GrGLInterface is provided then the
     * result of GrGLMakeNativeInterface() is used if it succeeds.
     */
    static sk_sp<GrDirectContext> MakeGL(sk_sp<const GrGLInterface>, const GrContextOptions&);
    static sk_sp<GrDirectContext> MakeGL(sk_sp<const GrGLInterface>);
    static sk_sp<GrDirectContext> MakeGL(const GrContextOptions&);
    static sk_sp<GrDirectContext> MakeGL();
#endif

Apparently the SK_GL flag is not being set correctly. My workaround was just adding -DCMAKE_CXX_FLAGS="-DSK_GL" to my build script.

@acmlira acmlira added bug Something isn't working help wanted Extra attention is needed labels Nov 6, 2020
@acmlira acmlira closed this as completed Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant