Skip to content

Commit

Permalink
Fix Skia build
Browse files Browse the repository at this point in the history
Skia sample code uses private header files, we have no choice but to import them too.
  • Loading branch information
ubald committed May 23, 2018
1 parent 31dd3b5 commit 945163a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion TODO.md
@@ -1,3 +1,3 @@
# TODO

* Build Skia with `is_official_build=true`
* [DONE] Build Skia with `is_official_build=true`
2 changes: 1 addition & 1 deletion extlib/skia/CMakeLists.txt
Expand Up @@ -32,6 +32,6 @@ add_custom_command(OUTPUT ${SKIA_STATIC_LIB}

add_custom_target(skia DEPENDS ${SKIA_STATIC_LIB})

file(GLOB SKIA_INCLUDE_DIRS_ ${CMAKE_CURRENT_LIST_DIR}/../external/skia/include/*)
file(GLOB SKIA_INCLUDE_DIRS_ ${CMAKE_CURRENT_LIST_DIR}/../external/skia/include/* ${CMAKE_CURRENT_LIST_DIR}/../external/skia/src/*)
set(SKIA_INCLUDE_DIRS "${SKIA_INCLUDE_DIRS_}" PARENT_SCOPE)
set(SKIA_LIBRARIES ${SKIA_STATIC_LIB} PARENT_SCOPE)
5 changes: 3 additions & 2 deletions psychic-ui/Window.cpp
Expand Up @@ -3,6 +3,7 @@
#include "Window.hpp"
#include "SkSurface.h"
#include "gl/GrGLInterface.h"
#include "gl/GrGLUtil.h"


namespace psychic_ui {
Expand Down Expand Up @@ -79,7 +80,7 @@ namespace psychic_ui {

void Window::initSkia() {
auto interface = GrGLMakeNativeInterface();
_sk_context = GrContext::MakeGL(nullptr).release();
_sk_context = GrContext::MakeGL(interface).release();
getSkiaSurface();
}

Expand All @@ -92,7 +93,7 @@ namespace psychic_ui {

GrGLFramebufferInfo framebufferInfo{};
framebufferInfo.fFBOID = 0; // assume default framebuffer
framebufferInfo.fFormat = 0x8058; // TODO: Get proper values
framebufferInfo.fFormat = GR_GL_RGBA8;


GrBackendRenderTarget backendRenderTarget(
Expand Down

0 comments on commit 945163a

Please sign in to comment.