diff options
-rw-r--r-- | gyp/ports.gyp | 2 | ||||
-rw-r--r-- | src/gpu/gl/command_buffer/SkCommandBufferGLContext.cpp | 3 | ||||
-rw-r--r-- | src/ports/SkOSEnvironment.cpp | 19 | ||||
-rw-r--r-- | src/ports/SkOSEnvironment.h | 15 | ||||
-rw-r--r-- | tests/RTConfRegistryTest.cpp | 13 |
5 files changed, 41 insertions, 11 deletions
diff --git a/gyp/ports.gyp b/gyp/ports.gyp index 35f5284c18..d685b2acb6 100644 --- a/gyp/ports.gyp +++ b/gyp/ports.gyp @@ -49,6 +49,8 @@ '../src/ports/SkGlobalInitialization_default.cpp', '../src/ports/SkMemory_malloc.cpp', + '../src/ports/SkOSEnvironment.h', + '../src/ports/SkOSEnvironment.cpp', '../src/ports/SkOSFile_posix.cpp', '../src/ports/SkOSFile_stdio.cpp', '../src/ports/SkOSFile_win.cpp', diff --git a/src/gpu/gl/command_buffer/SkCommandBufferGLContext.cpp b/src/gpu/gl/command_buffer/SkCommandBufferGLContext.cpp index 61eab4bebf..cf9da9365b 100644 --- a/src/gpu/gl/command_buffer/SkCommandBufferGLContext.cpp +++ b/src/gpu/gl/command_buffer/SkCommandBufferGLContext.cpp @@ -9,6 +9,7 @@ #include "gl/GrGLInterface.h" #include "gl/GrGLAssembleInterface.h" #include "gl/command_buffer/SkCommandBufferGLContext.h" +#include "../ports/SkOSEnvironment.h" #include "../ports/SkOSLibrary.h" #if defined SK_BUILD_FOR_MAC @@ -189,6 +190,8 @@ void SkCommandBufferGLContext::initializeGLContext(void* nativeWindow, const int return; } + // Make sure CHROMIUM_path_rendering is enabled for NVPR support. + sk_setenv("CHROME_COMMAND_BUFFER_GLES2_ARGS", "--enable-gl-path-rendering"); fDisplay = gfGetDisplay(EGL_DEFAULT_DISPLAY); if (EGL_NO_DISPLAY == fDisplay) { SkDebugf("Command Buffer: Could not create EGL display.\n"); diff --git a/src/ports/SkOSEnvironment.cpp b/src/ports/SkOSEnvironment.cpp new file mode 100644 index 0000000000..cc7aa18cff --- /dev/null +++ b/src/ports/SkOSEnvironment.cpp @@ -0,0 +1,19 @@ + +/* + * Copyright 2015 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "SkOSEnvironment.h" +#include <stdlib.h> + +void sk_setenv(const char* key, const char* value) { +#ifdef SK_BUILD_FOR_WIN32 + _putenv_s(key, value); +#else + setenv(key, value, 1); +#endif +} + diff --git a/src/ports/SkOSEnvironment.h b/src/ports/SkOSEnvironment.h new file mode 100644 index 0000000000..fdbce7a826 --- /dev/null +++ b/src/ports/SkOSEnvironment.h @@ -0,0 +1,15 @@ + +/* + * Copyright 2015 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef SkOSEnvironment_DEFINED +#define SkOSEnvironment_DEFINED + +void sk_setenv(const char* key, const char* value); + +#endif + diff --git a/tests/RTConfRegistryTest.cpp b/tests/RTConfRegistryTest.cpp index 84ce942bf6..be019f70b4 100644 --- a/tests/RTConfRegistryTest.cpp +++ b/tests/RTConfRegistryTest.cpp @@ -6,28 +6,19 @@ */ #include "SkRTConf.h" +#include "SkOSEnvironment.h" #include "Test.h" -#include <stdlib.h> - // Friended proxy for SkRTConfRegistry::parse() template <typename T> bool test_rt_conf_parse(SkRTConfRegistry* reg, const char* key, T* value) { return reg->parse(key, value); } -static void portable_setenv(const char* key, const char* value) { -#ifdef SK_BUILD_FOR_WIN32 - _putenv_s(key, value); -#else - setenv(key, value, 1); -#endif -} - DEF_TEST(SkRTConfRegistry, reporter) { SkRTConfRegistry reg; - portable_setenv("skia_nonexistent_item", "132"); + sk_setenv("skia_nonexistent_item", "132"); int result = 0; test_rt_conf_parse(®, "nonexistent.item", &result); REPORTER_ASSERT(reporter, result == 132); |