Wire up SDL on Android

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/a4d3797c3b0f0cac8493c46cb334ca88a5d6ccf6

Review URL: https://codereview.chromium.org/1415453009
This commit is contained in:
joshualitt 2015-11-05 11:49:35 -08:00 committed by Commit bot
parent 691ad76fca
commit 474a9ea051
16 changed files with 2264 additions and 28 deletions

View File

@ -238,6 +238,7 @@
'skia_moz2d%': 0,
'skia_is_bot%': '<(skia_is_bot)',
'skia_egl%': '<(skia_egl)',
'skia_use_sdl%': 0,
'skia_fast%': 0,
'skia_fast_flags': [
'-O3', # Even for Debug builds.

View File

@ -9,9 +9,6 @@
# * Basic widgets and controls.
{
'variables': {
'skia_use_sdl%': 0,
},
'targets': [
{
'target_name': 'views',

View File

@ -45,7 +45,7 @@
'views.gyp:views',
],
'conditions' : [
[ 'skia_os == "android"', {
[ 'skia_os == "android" and skia_use_sdl == 0', {
'dependencies': [
'android_deps.gyp:Android_VisualBench',
'android_deps.gyp:native_app_glue',

View File

@ -1,4 +1,3 @@
/*
* Copyright 2006 The Android Open Source Project
*
@ -6,7 +5,6 @@
* found in the LICENSE file.
*/
#ifndef SkOSWindow_SDL_DEFINED
#define SkOSWindow_SDL_DEFINED
@ -14,14 +12,14 @@
#include "SDL_opengl.h"
#include "SkWindow.h"
class SkOSWindow : public SkWindow {
public:
SkOSWindow(void* screen);
virtual ~SkOSWindow();
static bool PostEvent(SkEvent* evt, SkEventSinkID, SkMSec delay) { SkFAIL("not implemented\n");
return false;
static bool PostEvent(SkEvent* evt, SkEventSinkID, SkMSec delay) {
SkFAIL("not implemented\n");
return false;
}
enum SkBackEndTypes {
@ -50,10 +48,13 @@ public:
protected:
void onSetTitle(const char title[]) override;
void onHandleInval(const SkIRect&) override;
void onPDFSaved(const char title[], const char desc[], const char path[]) override;
private:
void handleEvents();
bool fQuit;
uint32_t fWindowFlags;
SDL_Window* fWindow;
SDL_GLContext fGLContext;

View File

@ -127,7 +127,7 @@ private:
#elif defined(SK_BUILD_FOR_ANDROID)
#include "SkOSWindow_Android.h"
#elif defined(SK_BUILD_FOR_UNIX)
#include "SkOSWindow_Unix.h"
#include "SkOSWindow_Unix.h"
#elif defined(SK_BUILD_FOR_IOS)
#include "SkOSWindow_iOS.h"
#endif

View File

@ -1,3 +1,4 @@
include ':sample_app'
include ':visualbench'
include ':visualbenchsdl'
include ':canvasproof'

View File

@ -0,0 +1,47 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.skia.visualbench"
minSdkVersion 19
signingConfig signingConfigs.debug
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
sourceSets.main.jni.srcDirs = [] //disable automatic ndk-build call
sourceSets.main.jniLibs.srcDir "src/main/libs"
productFlavors {
arm {}
arm64 {}
x86 {}
x86_64 {}
mips {}
mips64 {}
}
// make sure that app is built and shared libraries are copied to correct directories
applicationVariants.all{ variant ->
def buildNativeLib = task("${variant.name}_NativeLib", type:Exec) {
workingDir '../../../..' // top-level skia directory
commandLine constructBuildCommand(variant, "CopyVisualBenchDeps").split()
environment PATH: getPathWithDepotTools()
environment ANDROID_SDK_ROOT: getSDKPath()
}
buildNativeLib.onlyIf { !project.hasProperty("suppressNativeBuild") }
TaskCollection<Task> assembleTask
assembleTask = project.tasks.matching {
it.name.contains("assemble") &&
it.name.toLowerCase().endsWith(variant.name.toLowerCase())
}
assembleTask.getAt(0).dependsOn buildNativeLib
}
}

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- BEGIN_INCLUDE(manifest) -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.skia"
android:versionCode="1"
android:versionName="1.0">
<!-- This is the platform API where NativeActivity was introduced. -->
<uses-sdk android:minSdkVersion="19" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_ALL_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<application android:label="VisualBenchActivity">
<activity android:name=".VisualBenchActivity"
android:label="VisualBenchActivity"
android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<meta-data android:name="android.app.lib_name"
android:value="visualbench" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
<!-- END_INCLUDE(manifest) -->

View File

@ -0,0 +1,14 @@
/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
package com.skia;
import org.libsdl.app.SDLActivity;
public class VisualBenchActivity extends SDLActivity {
// TODO wire up command line arguments
}

View File

@ -0,0 +1,62 @@
/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
package com.skia;
import android.app.Instrumentation;
import android.content.Intent;
import android.test.ActivityUnitTestCase;
import android.util.Log;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.lang.StringBuilder;
public class VisualBenchTestActivity extends ActivityUnitTestCase<VisualBenchActivity> {
private VisualBenchActivity mActivity;
private Instrumentation mInstrumentation;
public VisualBenchTestActivity() {
super(VisualBenchActivity.class);
}
protected void setUp() throws Exception {
super.setUp();
mInstrumentation = getInstrumentation();
}
private String getFlags() throws IOException {
InputStream s = getInstrumentation().getTargetContext().getResources().getAssets().open("nanobench_flags.txt");
BufferedReader r = new BufferedReader(new InputStreamReader(s));
StringBuilder flags = new StringBuilder();
String sep = System.getProperty("line.separator");
String line;
while ((line = r.readLine()) != null) {
flags.append(line);
flags.append(sep);
}
s.close();
return flags.toString();
}
public void testVisualBench() throws InterruptedException, IOException {
String pkg = getInstrumentation().getTargetContext().getPackageName();
Intent intent = new Intent(getInstrumentation().getTargetContext(),
VisualBenchActivity.class);
String args = getFlags();
intent.putExtra("cmdLineFlags", args);
mActivity = launchActivityWithIntent(pkg, VisualBenchActivity.class, intent);
assertNotNull("mActivity is null", mActivity);
Thread.sleep(5000);
while (!mActivity.isDestroyed()) {
Log.d("skiatest", "Waiting for subprocess to finish.");
Thread.sleep(1000);
}
}
}

View File

@ -210,5 +210,71 @@
},
],
},
# TODO all of this duplicated code can be removed when SDL becomes the default
# Currently, to use this you have to override skia_use_sdl
{
'target_name': 'CopyVisualBenchSDLDeps',
'type': 'none',
'dependencies': [
'skia_lib.gyp:skia_lib',
'visualbench.gyp:visualbench',
],
'copies': [
# Copy all shared libraries into the Android app's libs folder. Note
# that this copy requires us to build SkiaAndroidApp after those
# libraries, so that they exist by the time it occurs. If there are no
# libraries to copy, this will cause an error in Make, but the app will
# still build.
{
'destination': '<(android_base)/apps/visualbenchsdl/src/main/libs/<(android_arch)',
'conditions': [
[ 'skia_shared_lib', {
'files': [
'<(SHARED_LIB_DIR)/libskia_android.so',
'<(SHARED_LIB_DIR)/libvisualbench.so',
]}, {
'files': [
'<(SHARED_LIB_DIR)/libvisualbench.so',
]}
],
],
},
],
},
{
'target_name': 'VisualBenchSDL_APK',
'type': 'none',
'dependencies': [
'CopyVisualBenchSDLDeps',
],
'actions': [
{
'action_name': 'SkiaVisualBenchSDL_apk',
'inputs': [
'<(android_base)/apps/visualbenchsdl/src/main/AndroidManifest.xml',
'<(android_base)/apps/visualbenchsdl/src/main/java/org/libsdl/app/SDLActivity.java',
'<(android_base)/apps/visualbenchsdl/src/main/java/com/skia/VisualBenchActivity.java',
'<(android_base)/apps/visualbenchsdl/src/main/libs/<(android_arch)/libvisualbench.so',
],
'conditions': [
[ 'skia_shared_lib', {
'inputs': [
'<(android_base)/apps/visualbenchsdl/src/main/libs/<(android_arch)/libskia_android.so',
],
}],
],
'outputs': [
'<(android_base)/apps/visualbenchsdl/build/outputs/apk/visualbench-<(android_variant)-<(android_apk_suffix)',
],
'action': [
'<(android_base)/apps/gradlew',
':visualbenchsdl:assemble<(android_variant)<(android_buildtype)',
'-p<(android_base)/apps/visualbenchsdl',
'-PsuppressNativeBuild',
],
},
],
},
],
}

View File

@ -7,7 +7,11 @@
#include "SkOSWindow_SDL.h"
#include "SkCanvas.h"
#if defined(SK_BUILD_FOR_ANDROID)
#include <GLES/gl.h>
#else
#include <GL/gl.h>
#endif
const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;
@ -19,17 +23,50 @@ static void handle_error() {
}
SkOSWindow::SkOSWindow(void* screen) : fQuit(false) , fGLContext(nullptr) {
//Create window
SDL_Init(SDL_INIT_VIDEO|SDL_INIT_GAMECONTROLLER|SDL_INIT_EVENTS);
fWindow = SDL_CreateWindow("SDL Window", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
SCREEN_WIDTH, SCREEN_HEIGHT,
SDL_WINDOW_OPENGL|SDL_WINDOW_SHOWN );
#if defined(SK_BUILD_FOR_ANDROID)
// TODO we should try and get a 3.0 context first
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
fWindowFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE |
SDL_WINDOW_BORDERLESS | SDL_WINDOW_FULLSCREEN_DESKTOP |
SDL_WINDOW_ALLOW_HIGHDPI;
#else
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_StartTextInput();
fWindowFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE;
#endif
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS) != 0) {
handle_error();
return;
}
SDL_DisplayMode dm;
if (SDL_GetDesktopDisplayMode(0, &dm) != 0) {
handle_error();
return;
}
fWindow = SDL_CreateWindow("SDL Window", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
dm.w, dm.h, fWindowFlags);
if (!fWindow) {
handle_error();
return;
}
SDL_StartTextInput();
this->resize(SCREEN_WIDTH, SCREEN_HEIGHT);
this->resize(SkIntToScalar(dm.w), SkIntToScalar(dm.h));
}
SkOSWindow::~SkOSWindow() {
@ -49,22 +86,32 @@ void SkOSWindow::detach() {
SDL_GL_DeleteContext(fGLContext);
fGLContext = nullptr;
}
#if defined(SK_BUILD_FOR_ANDROID)
if (fWindow) {
// Destroy window
// Not totally sure why, but we have to do this or swapbuffers will hang
SDL_DestroyWindow(fWindow);
fWindow = nullptr;
}
#endif
}
bool SkOSWindow::attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*) {
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
bool SkOSWindow::attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo* info) {
if (!fWindow) {
fWindow = SDL_CreateWindow("SDL Window", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
SCREEN_WIDTH, SCREEN_HEIGHT,
fWindowFlags);
}
if (msaaSampleCount > 0) {
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, msaaSampleCount);
}
info->fSampleCount = msaaSampleCount;
info->fStencilBits = 8;
fGLContext = SDL_GL_CreateContext(fWindow);
if (!fGLContext) {
handle_error();
@ -77,7 +124,7 @@ bool SkOSWindow::attach(SkBackEndTypes attachType, int msaaSampleCount, Attachme
return false;
}
glViewport(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
glViewport(0, 0, SkScalarFloorToInt(this->width()), SkScalarFloorToInt(this->height()));
glClearColor(1, 1, 1, 1);
glClearStencil(0);
glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
@ -209,14 +256,23 @@ void SkEvent::SignalQueueTimer(SkMSec delay) {
// just need to record the delay time. We handle waking up for it in
}
//////////////////////////////////////////////////////////////////////////////////////////////
void SkOSWindow::onHandleInval(const SkIRect& rect) {
}
void SkOSWindow::onPDFSaved(const char title[], const char desc[], const char path[]) {
}
//////////////////////////////////////////////////////////////////////////////////////////////
#include "SkApplication.h"
#include "SkEvent.h"
#include "SkWindow.h"
int main(int argc, char** argv){
#if defined(SK_BUILD_FOR_ANDROID)
int SDL_main(int argc, char** argv) {
#else
int main(int argc, char** argv) {
#endif
SkOSWindow* window = create_sk_window(nullptr, argc, argv);
// drain any events that occurred before |window| was assigned.

145
third_party/libsdl/android/SDL_config.h vendored Normal file
View File

@ -0,0 +1,145 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2015 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef _SDL_config_android_h
#define _SDL_config_android_h
#include "SDL_platform.h"
/**
* \file SDL_config_android.h
*
* This is a configuration that can be used to build SDL for Android
*/
#include <stdarg.h>
#define HAVE_GCC_ATOMICS 1
#define HAVE_ALLOCA_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_SETENV 1
#define HAVE_PUTENV 1
#define HAVE_SETENV 1
#define HAVE_UNSETENV 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1
#define HAVE_STRDUP 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_VSSCANF 1
#define HAVE_VSNPRINTF 1
#define HAVE_M_PI 1
#define HAVE_ATAN 1
#define HAVE_ATAN2 1
#define HAVE_ACOS 1
#define HAVE_ASIN 1
#define HAVE_CEIL 1
#define HAVE_COPYSIGN 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_FABS 1
#define HAVE_FLOOR 1
#define HAVE_LOG 1
#define HAVE_POW 1
#define HAVE_SCALBN 1
#define HAVE_SIN 1
#define HAVE_SINF 1
#define HAVE_SQRT 1
#define HAVE_SQRTF 1
#define HAVE_TAN 1
#define HAVE_TANF 1
#define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1
#define HAVE_SYSCONF 1
#define HAVE_CLOCK_GETTIME 1
#define SIZEOF_VOIDP 4
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_ANDROID 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various input drivers */
#define SDL_JOYSTICK_ANDROID 1
#define SDL_HAPTIC_DUMMY 1
/* Enable various shared object loading systems */
#define SDL_LOADSO_DLOPEN 1
/* Enable various threading systems */
#define SDL_THREAD_PTHREAD 1
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
/* Enable various timer systems */
#define SDL_TIMER_UNIX 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_ANDROID 1
/* Enable OpenGL ES */
#define SDL_VIDEO_OPENGL_ES 1
#define SDL_VIDEO_OPENGL_ES2 1
#define SDL_VIDEO_OPENGL_EGL 1
#define SDL_VIDEO_RENDER_OGL_ES 1
#define SDL_VIDEO_RENDER_OGL_ES2 1
/* Enable system power support */
#define SDL_POWER_ANDROID 1
/* Enable the filesystem driver */
#define SDL_FILESYSTEM_ANDROID 1
#endif /* _SDL_config_android_h */

View File

@ -0,0 +1,127 @@
# Copyright 2015 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Linux specific files and settings for SDL
{
#TODO what is really necessary here
'link_settings': {
'libraries': [
'-ldl',
'-lGLESv1_CM',
'-lGLESv2',
'-llog',
'-landroid',
],
},
'sources': [
'<(src_dir)/src/SDL.c',
'<(src_dir)/src/SDL_assert.c',
'<(src_dir)/src/SDL_error.c',
'<(src_dir)/src/SDL_hints.c',
'<(src_dir)/src/SDL_log.c',
'<(src_dir)/src/atomic/SDL_atomic.c',
'<(src_dir)/src/atomic/SDL_spinlock.c',
'<(src_dir)/src/audio/SDL_audio.c',
'<(src_dir)/src/audio/SDL_audiocvt.c',
'<(src_dir)/src/audio/SDL_audiodev.c',
'<(src_dir)/src/audio/SDL_audiotypecvt.c',
'<(src_dir)/src/audio/SDL_mixer.c',
'<(src_dir)/src/audio/SDL_wave.c',
'<(src_dir)/src/audio/dummy/SDL_dummyaudio.c',
'<(src_dir)/src/audio/android/SDL_androidaudio.c',
'<(src_dir)/src/cpuinfo/SDL_cpuinfo.c',
'<(src_dir)/src/dynapi/SDL_dynapi.c',
'<(src_dir)/src/events/SDL_clipboardevents.c',
'<(src_dir)/src/events/SDL_dropevents.c',
'<(src_dir)/src/events/SDL_events.c',
'<(src_dir)/src/events/SDL_gesture.c',
'<(src_dir)/src/events/SDL_keyboard.c',
'<(src_dir)/src/events/SDL_mouse.c',
'<(src_dir)/src/events/SDL_quit.c',
'<(src_dir)/src/events/SDL_touch.c',
'<(src_dir)/src/events/SDL_windowevents.c',
'<(src_dir)/src/file/SDL_rwops.c',
'<(src_dir)/src/haptic/SDL_haptic.c',
'<(src_dir)/src/joystick/SDL_gamecontroller.c',
'<(src_dir)/src/joystick/SDL_joystick.c',
'<(src_dir)/src/joystick/android/SDL_sysjoystick.c',
'<(src_dir)/src/power/SDL_power.c',
'<(src_dir)/src/power/android/SDL_syspower.c',
'<(src_dir)/src/loadso/dlopen/SDL_sysloadso.c',
'<(src_dir)/src/render/SDL_d3dmath.c',
'<(src_dir)/src/render/SDL_render.c',
'<(src_dir)/src/render/SDL_yuv_mmx.c',
'<(src_dir)/src/render/SDL_yuv_sw.c',
'<(src_dir)/src/render/direct3d/SDL_render_d3d.c',
'<(src_dir)/src/render/direct3d11/SDL_render_d3d11.c',
'<(src_dir)/src/render/opengl/SDL_render_gl.c',
'<(src_dir)/src/render/opengl/SDL_shaders_gl.c',
'<(src_dir)/src/render/opengles/SDL_render_gles.c',
'<(src_dir)/src/render/opengles2/SDL_render_gles2.c',
'<(src_dir)/src/render/opengles2/SDL_shaders_gles2.c',
'<(src_dir)/src/render/psp/SDL_render_psp.c',
'<(src_dir)/src/render/software/SDL_blendfillrect.c',
'<(src_dir)/src/render/software/SDL_blendline.c',
'<(src_dir)/src/render/software/SDL_blendpoint.c',
'<(src_dir)/src/render/software/SDL_drawline.c',
'<(src_dir)/src/render/software/SDL_drawpoint.c',
'<(src_dir)/src/render/software/SDL_render_sw.c',
'<(src_dir)/src/render/software/SDL_rotate.c',
'<(src_dir)/src/stdlib/SDL_getenv.c',
'<(src_dir)/src/stdlib/SDL_iconv.c',
'<(src_dir)/src/stdlib/SDL_malloc.c',
'<(src_dir)/src/stdlib/SDL_qsort.c',
'<(src_dir)/src/stdlib/SDL_stdlib.c',
'<(src_dir)/src/stdlib/SDL_string.c',
'<(src_dir)/src/thread/SDL_thread.c',
'<(src_dir)/src/timer/SDL_timer.c',
'<(src_dir)/src/video/SDL_RLEaccel.c',
'<(src_dir)/src/video/SDL_blit.c',
'<(src_dir)/src/video/SDL_blit_0.c',
'<(src_dir)/src/video/SDL_blit_1.c',
'<(src_dir)/src/video/SDL_blit_A.c',
'<(src_dir)/src/video/SDL_blit_N.c',
'<(src_dir)/src/video/SDL_blit_auto.c',
'<(src_dir)/src/video/SDL_blit_copy.c',
'<(src_dir)/src/video/SDL_blit_slow.c',
'<(src_dir)/src/video/SDL_bmp.c',
'<(src_dir)/src/video/SDL_clipboard.c',
'<(src_dir)/src/video/SDL_egl.c',
'<(src_dir)/src/video/SDL_fillrect.c',
'<(src_dir)/src/video/SDL_pixels.c',
'<(src_dir)/src/video/SDL_rect.c',
'<(src_dir)/src/video/SDL_shape.c',
'<(src_dir)/src/video/SDL_stretch.c',
'<(src_dir)/src/video/SDL_surface.c',
'<(src_dir)/src/video/SDL_video.c',
'<(src_dir)/src/video/android/SDL_androidgl.c',
'<(src_dir)/src/video/android/SDL_androidkeyboard.c',
'<(src_dir)/src/video/android/SDL_androidwindow.c',
'<(src_dir)/src/video/android/SDL_androidmouse.c',
'<(src_dir)/src/video/android/SDL_androidvideo.c',
'<(src_dir)/src/video/android/SDL_androidclipboard.c',
'<(src_dir)/src/video/android/SDL_androidtouch.c',
'<(src_dir)/src/video/android/SDL_androidevents.c',
'<(src_dir)/src/video/android/SDL_androidmessagebox.c',
'<(src_dir)/src/thread/pthread/SDL_systhread.c',
'<(src_dir)/src/thread/pthread/SDL_syssem.c',
'<(src_dir)/src/thread/pthread/SDL_sysmutex.c',
'<(src_dir)/src/thread/pthread/SDL_syscond.c',
'<(src_dir)/src/thread/pthread/SDL_systls.c',
'<(src_dir)/src/filesystem/android/SDL_sysfilesystem.c',
'<(src_dir)/src/timer/unix/SDL_systimer.c',
'<(src_dir)/src/core/android/SDL_android.c',
'<(src_dir)/src/haptic/dummy/SDL_syshaptic.c',
'<(src_dir)/src/main/android/SDL_android_main.c',
],
'defines': [
'GL_GLEXT_PROTOTYPES',
],
'cflags': [
'-fPIC',
'-O3',
'-fvisibility=hidden',
],
}

View File

@ -16,6 +16,7 @@
'direct_dependent_settings': {
'include_dirs': [
'<(src_dir)/include',
'<(src_dir)/src',
]
},
'cflags': [
@ -28,6 +29,11 @@
'linux/sdl_linux.gypi',
]
}],
['skia_os == "android"', {
'includes': [
'android/sdl_android.gypi',
]
}],
],
},
],