diff options
author | reed <reed@google.com> | 2016-04-28 08:12:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-28 08:12:55 -0700 |
commit | 28d5bdd97ebbbdfff49d2e719b24a6343b0f0b48 (patch) | |
tree | 0844d9f033c93102c900b7b4e11604e7d53a907e | |
parent | 9fbee8408ec4578aead049f1bf43f1d9d4039b7b (diff) |
Revert of Repurpose Release_Developer BUILDTYPE and remove SK_DEVELOPER. (patchset #2 id:20001 of https://codereview.chromium.org/1927583002/ )
Reason for revert:
still blocking DEPS roll
Original issue's description:
> Repurpose Release_Developer BUILDTYPE and remove SK_DEVELOPER.
>
> The Release_Developer build type is now used to build Skia with
> release level optimizations but still enable SK_DEBUG. This in turn
> means that SkASSERTS and SkRTConf are available in this mode.
>
> Further we can then remove SK_DEVELOPER as a define as it is true
> iff SK_DEBUG is true.
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1927583002
> DOCS_PREVIEW= https://skia.org/?cl=1927583002
>
> Committed: https://skia.googlesource.com/skia/+/48d6f88479e72efaf9b9d8f9c0769acb1ba773db
TBR=bungeman@gmail.com,bungeman@google.com,benjaminwagner@google.com,djsollen@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review-Url: https://codereview.chromium.org/1918253006
-rw-r--r-- | gyp/common.gypi | 4 | ||||
-rw-r--r-- | include/core/SkClipStack.h | 4 | ||||
-rw-r--r-- | include/core/SkTypes.h | 6 | ||||
-rw-r--r-- | include/gpu/GrConfig.h | 4 | ||||
-rw-r--r-- | include/utils/SkDumpCanvas.h | 2 | ||||
-rw-r--r-- | include/utils/SkRTConf.h | 2 | ||||
-rw-r--r-- | site/dev/runtime/index.md | 13 | ||||
-rw-r--r-- | src/core/SkClipStack.cpp | 2 | ||||
-rw-r--r-- | src/core/SkGraphics.cpp | 2 | ||||
-rw-r--r-- | src/core/SkResourceCache.cpp | 2 | ||||
-rw-r--r-- | src/core/SkStream.cpp | 4 | ||||
-rw-r--r-- | src/gpu/GrLayerCache.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrLayerCache.h | 2 | ||||
-rw-r--r-- | src/gpu/gl/GrGLGpu.h | 2 | ||||
-rw-r--r-- | src/gpu/vk/GrVkResourceProvider.h | 2 | ||||
-rw-r--r-- | src/utils/SkDumpCanvas.cpp | 2 | ||||
-rw-r--r-- | tests/RuntimeConfigTest.cpp | 8 | ||||
-rw-r--r-- | tools/pinspect.cpp | 4 |
18 files changed, 39 insertions, 28 deletions
diff --git a/gyp/common.gypi b/gyp/common.gypi index e0196cfd2a..ae6dd628cc 100644 --- a/gyp/common.gypi +++ b/gyp/common.gypi @@ -97,11 +97,11 @@ # one makefile and allow someone to add SK_DEBUG etc for their own # debugging purposes. 'configurations': { - 'Debug': { 'defines': [ 'SK_DEBUG=1' ] }, + 'Debug': { 'defines': [ 'SK_DEVELOPER=1' ] }, 'Release': { 'defines': [ 'NDEBUG' ] }, 'Release_Developer': { 'inherit_from': ['Release'], - 'defines': [ 'SK_DEBUG=1' ], + 'defines': [ 'SK_DEVELOPER=1' ], }, }, }], diff --git a/include/core/SkClipStack.h b/include/core/SkClipStack.h index 3156941125..973f70a42b 100644 --- a/include/core/SkClipStack.h +++ b/include/core/SkClipStack.h @@ -170,7 +170,7 @@ public: */ void replay(SkCanvasClipVisitor*) const; -#ifdef SK_DEBUG +#ifdef SK_DEVELOPER /** * Dumps the element to SkDebugf. This is intended for Skia development debugging * Don't rely on the existence of this function or the formatting of its output. @@ -353,7 +353,7 @@ public: int32_t getTopmostGenID() const; -#ifdef SK_DEBUG +#ifdef SK_DEVELOPER /** * Dumps the contents of the clip stack to SkDebugf. This is intended for Skia development * debugging. Don't rely on the existence of this function or the formatting of its output. diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h index f9d0c533d3..a94a59233f 100644 --- a/include/core/SkTypes.h +++ b/include/core/SkTypes.h @@ -161,6 +161,12 @@ inline void operator delete(void* p) { // and if it's true the assert passes; if it's false, we'll print the message and the assert fails. #define SkASSERTF(cond, fmt, ...) SkASSERT((cond) || (SkDebugf(fmt"\n", __VA_ARGS__), false)) +#ifdef SK_DEVELOPER + #define SkDEVCODE(code) code +#else + #define SkDEVCODE(code) +#endif + #ifdef SK_IGNORE_TO_STRING #define SK_TO_STRING_NONVIRT() #define SK_TO_STRING_VIRT() diff --git a/include/gpu/GrConfig.h b/include/gpu/GrConfig.h index acdff3af2b..8e0efbd472 100644 --- a/include/gpu/GrConfig.h +++ b/include/gpu/GrConfig.h @@ -33,7 +33,7 @@ */ #if !defined(GR_CACHE_STATS) - #if defined(SK_DEBUG) || defined(SK_DUMP_STATS) + #if defined(SK_DEVELOPER) || defined(SK_DEBUG) || defined(SK_DUMP_STATS) #define GR_CACHE_STATS 1 #else #define GR_CACHE_STATS 0 @@ -41,7 +41,7 @@ #endif #if !defined(GR_GPU_STATS) - #if defined(SK_DEBUG) || defined(SK_DUMP_STATS) + #if defined(SK_DEVELOPER) || defined(SK_DEBUG) || defined(SK_DUMP_STATS) #define GR_GPU_STATS 1 #else #define GR_GPU_STATS 0 diff --git a/include/utils/SkDumpCanvas.h b/include/utils/SkDumpCanvas.h index 2cf37c3b8c..1c16bf3f03 100644 --- a/include/utils/SkDumpCanvas.h +++ b/include/utils/SkDumpCanvas.h @@ -10,7 +10,7 @@ #include "SkCanvas.h" -#ifdef SK_DEBUG +#ifdef SK_DEVELOPER /** This class overrides all the draw methods on SkCanvas, and formats them as text, and then sends that to a Dumper helper object. diff --git a/include/utils/SkRTConf.h b/include/utils/SkRTConf.h index d80e418419..c3e97ef5e3 100644 --- a/include/utils/SkRTConf.h +++ b/include/utils/SkRTConf.h @@ -49,7 +49,7 @@ protected: SkString fDescription; }; -#ifdef SK_DEBUG +#ifdef SK_DEVELOPER #define SK_CONF_DECLARE(confType, varName, confName, defaultValue, description) static SkRTConf<confType> varName(confName, defaultValue, description) #define SK_CONF_SET(confname, value) \ skRTConfRegistry().set(confname, value, true) diff --git a/site/dev/runtime/index.md b/site/dev/runtime/index.md index 7c8246d23f..b7e656b29f 100644 --- a/site/dev/runtime/index.md +++ b/site/dev/runtime/index.md @@ -152,10 +152,11 @@ options. ## Are these things enabled all the time? -No, they are only enabled in builds where SK_DEBUG is defined. This includes both -`Debug` and `Release_Developer` gyp BUILDTYPES. The `Release_Developer` build type -has exactly the same build flags as `Release`, except it re-enables SK_DEBUG, which -in turn enables runtime configuration behavior. +In `Debug` builds, yes. `Release` builds disable runtime configuration by +default, but it is still useful to be able to tweak certain algorithm parameters +at runtime to do scripted performance studies. Therefore, a third build type, +`Release_Developer` has been added. This build type has exactly the same build +flags as `Release`, except it re-enables all runtime configuration behavior. Specifically: <!--?prettify?--> @@ -179,3 +180,7 @@ Runtime configuration variables of type `char \* ` cannot currently have spaces in them. Runtime variables are only fully supported for `int`, `unsigned int`, `float`, `double`, `bool`, and `char \*`. + +## Questions? Bugs? Improvements? + +Feel free to send feedback on this system to Greg Humphreys \(humper@google\.com\) diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp index e39aeeea80..4e53d8b850 100644 --- a/src/core/SkClipStack.cpp +++ b/src/core/SkClipStack.cpp @@ -859,7 +859,7 @@ int32_t SkClipStack::getTopmostGenID() const { return back->getGenID(); } -#ifdef SK_DEBUG +#ifdef SK_DEVELOPER void SkClipStack::Element::dump() const { static const char* kTypeStrings[] = { "empty", diff --git a/src/core/SkGraphics.cpp b/src/core/SkGraphics.cpp index d7022b770b..e263fdea5d 100644 --- a/src/core/SkGraphics.cpp +++ b/src/core/SkGraphics.cpp @@ -50,7 +50,7 @@ void SkGraphics::Init() { SkCpu::CacheRuntimeFeatures(); SkOpts::Init(); -#ifdef SK_DEBUG +#ifdef SK_DEVELOPER skRTConfRegistry().possiblyDumpFile(); skRTConfRegistry().validate(); if (skRTConfRegistry().hasNonDefault()) { diff --git a/src/core/SkResourceCache.cpp b/src/core/SkResourceCache.cpp index bacb8158aa..fa3cb9dbe0 100644 --- a/src/core/SkResourceCache.cpp +++ b/src/core/SkResourceCache.cpp @@ -549,7 +549,7 @@ static void cleanup_gResourceCache() { // Chrome seems to have funky multi-process things going on in unit tests that // makes this unsafe to delete when the main process atexit()s. // SkLazyPtr does the same sort of thing. -#if SK_DEBUG +#if SK_DEVELOPER delete gResourceCache; #endif } diff --git a/src/core/SkStream.cpp b/src/core/SkStream.cpp index e2b3e6454c..6dbde4dc6d 100644 --- a/src/core/SkStream.cpp +++ b/src/core/SkStream.cpp @@ -817,7 +817,7 @@ SkStreamAsset* SkDynamicMemoryWStream::detachAsStream() { void SkDebugWStream::newline() { -#if defined(SK_DEBUG) +#if defined(SK_DEBUG) || defined(SK_DEVELOPER) SkDebugf("\n"); fBytesWritten++; #endif @@ -825,7 +825,7 @@ void SkDebugWStream::newline() bool SkDebugWStream::write(const void* buffer, size_t size) { -#if defined(SK_DEBUG) +#if defined(SK_DEBUG) || defined(SK_DEVELOPER) char* s = new char[size+1]; memcpy(s, buffer, size); s[size] = 0; diff --git a/src/gpu/GrLayerCache.cpp b/src/gpu/GrLayerCache.cpp index b14423aaa2..8bdc3fb1f1 100644 --- a/src/gpu/GrLayerCache.cpp +++ b/src/gpu/GrLayerCache.cpp @@ -523,7 +523,7 @@ void GrLayerCache::processDeletedPictures() { } } -#ifdef SK_DEBUG +#ifdef SK_DEVELOPER void GrLayerCache::writeLayersToDisk(const SkString& dirName) { if (fAtlas) { diff --git a/src/gpu/GrLayerCache.h b/src/gpu/GrLayerCache.h index 2fa927197b..b341cb221d 100644 --- a/src/gpu/GrLayerCache.h +++ b/src/gpu/GrLayerCache.h @@ -352,7 +352,7 @@ public: SkDEBUGCODE(void validate() const;) -#ifdef SK_DEBUG +#ifdef SK_DEVELOPER void writeLayersToDisk(const SkString& dirName); #endif diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h index b6bc7baee7..c6f0f2205f 100644 --- a/src/gpu/gl/GrGLGpu.h +++ b/src/gpu/gl/GrGLGpu.h @@ -28,7 +28,7 @@ class GrPipeline; class GrNonInstancedMesh; class GrSwizzle; -#ifdef SK_DEBUG +#ifdef SK_DEVELOPER #define PROGRAM_CACHE_STATS #endif diff --git a/src/gpu/vk/GrVkResourceProvider.h b/src/gpu/vk/GrVkResourceProvider.h index 86aa5bce36..4853bf160c 100644 --- a/src/gpu/vk/GrVkResourceProvider.h +++ b/src/gpu/vk/GrVkResourceProvider.h @@ -83,7 +83,7 @@ public: private: -#ifdef SK_DEBUG +#ifdef SK_DEVELOPER #define GR_PIPELINE_STATE_CACHE_STATS #endif diff --git a/src/utils/SkDumpCanvas.cpp b/src/utils/SkDumpCanvas.cpp index e916bd095d..9530f86515 100644 --- a/src/utils/SkDumpCanvas.cpp +++ b/src/utils/SkDumpCanvas.cpp @@ -7,7 +7,7 @@ #include "SkDumpCanvas.h" -#ifdef SK_DEBUG +#ifdef SK_DEVELOPER #include "SkData.h" #include "SkPatchUtils.h" #include "SkPicture.h" diff --git a/tests/RuntimeConfigTest.cpp b/tests/RuntimeConfigTest.cpp index b863ee1fd8..d40a4f0dd6 100644 --- a/tests/RuntimeConfigTest.cpp +++ b/tests/RuntimeConfigTest.cpp @@ -16,12 +16,12 @@ DEF_TEST(RuntimeConfig, reporter) { REPORTER_ASSERT(reporter, 1 == c_RTConfTestVariable); SK_CONF_SET("test.utils.rtconf.testVariable", 2); -#ifdef SK_DEBUG +#ifdef SK_DEVELOPER REPORTER_ASSERT(reporter, 2 == c_RTConfTestVariable); -#else // not SK_DEBUG - // Can not change RTConf variables in SK_RELEASE. +#else // not SK_DEVELOPER + // Can not change RTConf variables in Release. REPORTER_ASSERT(reporter, 1 == c_RTConfTestVariable); -#endif // SK_DEBUG +#endif // SK_DEVELOPER // This should not give a warning. SK_CONF_TRY_SET("test.utils.rtconf.nonexistentVariable", 7); diff --git a/tools/pinspect.cpp b/tools/pinspect.cpp index 4dfabcdca4..57aaf1e722 100644 --- a/tools/pinspect.cpp +++ b/tools/pinspect.cpp @@ -45,12 +45,12 @@ static sk_sp<SkPicture> inspect(const char path[]) { } static void dumpOps(SkPicture* pic) { -#ifdef SK_DEBUG +#ifdef SK_DEVELOPER SkDebugfDumper dumper; SkDumpCanvas canvas(&dumper); canvas.drawPicture(pic); #else - printf("SK_DEBUG mode not enabled\n"); + printf("SK_DEVELOPER mode not enabled\n"); #endif } |