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=1931903002
DOCS_PREVIEW= https://skia.org/?cl=1931903002

Review-Url: https://codereview.chromium.org/1931903002
This commit is contained in:
djsollen 2016-04-29 06:41:35 -07:00 committed by Commit bot
parent fe635fd76b
commit efe46d2094
18 changed files with 27 additions and 48 deletions

View File

@ -97,11 +97,11 @@
# one makefile and allow someone to add SK_DEBUG etc for their own
# debugging purposes.
'configurations': {
'Debug': { 'defines': [ 'SK_DEVELOPER=1' ] },
'Debug': { 'defines': [ 'SK_DEBUG=1' ] },
'Release': { 'defines': [ 'NDEBUG' ] },
'Release_Developer': {
'inherit_from': ['Release'],
'defines': [ 'SK_DEVELOPER=1' ],
'defines': [ 'SK_DEBUG=1' ],
},
},
}],

View File

@ -170,7 +170,7 @@ public:
*/
void replay(SkCanvasClipVisitor*) const;
#ifdef SK_DEVELOPER
#ifdef SK_DEBUG
/**
* 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_DEVELOPER
#ifdef SK_DEBUG
/**
* 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.

View File

@ -161,12 +161,6 @@ 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()

View File

@ -33,7 +33,7 @@
*/
#if !defined(GR_CACHE_STATS)
#if defined(SK_DEVELOPER) || defined(SK_DEBUG) || defined(SK_DUMP_STATS)
#if 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_DEVELOPER) || defined(SK_DEBUG) || defined(SK_DUMP_STATS)
#if defined(SK_DEBUG) || defined(SK_DUMP_STATS)
#define GR_GPU_STATS 1
#else
#define GR_GPU_STATS 0

View File

@ -10,7 +10,7 @@
#include "SkCanvas.h"
#ifdef SK_DEVELOPER
#ifdef SK_DEBUG
/** This class overrides all the draw methods on SkCanvas, and formats them
as text, and then sends that to a Dumper helper object.

View File

@ -49,7 +49,7 @@ protected:
SkString fDescription;
};
#ifdef SK_DEVELOPER
#ifdef SK_DEBUG
#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)

View File

@ -152,11 +152,10 @@ options.
## Are these things enabled all the time?
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.
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.
Specifically:
<!--?prettify?-->
@ -180,7 +179,3 @@ 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\)

View File

@ -859,7 +859,7 @@ int32_t SkClipStack::getTopmostGenID() const {
return back->getGenID();
}
#ifdef SK_DEVELOPER
#ifdef SK_DEBUG
void SkClipStack::Element::dump() const {
static const char* kTypeStrings[] = {
"empty",

View File

@ -50,7 +50,7 @@ void SkGraphics::Init() {
SkCpu::CacheRuntimeFeatures();
SkOpts::Init();
#ifdef SK_DEVELOPER
#ifdef SK_DEBUG
skRTConfRegistry().possiblyDumpFile();
skRTConfRegistry().validate();
if (skRTConfRegistry().hasNonDefault()) {

View File

@ -544,15 +544,6 @@ void SkResourceCache::checkMessages() {
SK_DECLARE_STATIC_MUTEX(gMutex);
static SkResourceCache* gResourceCache = nullptr;
static void cleanup_gResourceCache() {
// We'll clean this up in our own tests, but disable for clients.
// 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_DEVELOPER
delete gResourceCache;
#endif
}
/** Must hold gMutex when calling. */
static SkResourceCache* get_cache() {
@ -564,7 +555,6 @@ static SkResourceCache* get_cache() {
#else
gResourceCache = new SkResourceCache(SK_DEFAULT_IMAGE_CACHE_LIMIT);
#endif
atexit(cleanup_gResourceCache);
}
return gResourceCache;
}

View File

@ -817,7 +817,7 @@ SkStreamAsset* SkDynamicMemoryWStream::detachAsStream() {
void SkDebugWStream::newline()
{
#if defined(SK_DEBUG) || defined(SK_DEVELOPER)
#if defined(SK_DEBUG)
SkDebugf("\n");
fBytesWritten++;
#endif
@ -825,7 +825,7 @@ void SkDebugWStream::newline()
bool SkDebugWStream::write(const void* buffer, size_t size)
{
#if defined(SK_DEBUG) || defined(SK_DEVELOPER)
#if defined(SK_DEBUG)
char* s = new char[size+1];
memcpy(s, buffer, size);
s[size] = 0;

View File

@ -523,7 +523,7 @@ void GrLayerCache::processDeletedPictures() {
}
}
#ifdef SK_DEVELOPER
#ifdef SK_DEBUG
void GrLayerCache::writeLayersToDisk(const SkString& dirName) {
if (fAtlas) {

View File

@ -352,7 +352,7 @@ public:
SkDEBUGCODE(void validate() const;)
#ifdef SK_DEVELOPER
#ifdef SK_DEBUG
void writeLayersToDisk(const SkString& dirName);
#endif

View File

@ -28,7 +28,7 @@ class GrPipeline;
class GrNonInstancedMesh;
class GrSwizzle;
#ifdef SK_DEVELOPER
#ifdef SK_DEBUG
#define PROGRAM_CACHE_STATS
#endif

View File

@ -83,7 +83,7 @@ public:
private:
#ifdef SK_DEVELOPER
#ifdef SK_DEBUG
#define GR_PIPELINE_STATE_CACHE_STATS
#endif

View File

@ -7,7 +7,7 @@
#include "SkDumpCanvas.h"
#ifdef SK_DEVELOPER
#ifdef SK_DEBUG
#include "SkData.h"
#include "SkPatchUtils.h"
#include "SkPicture.h"

View File

@ -16,12 +16,12 @@ DEF_TEST(RuntimeConfig, reporter) {
REPORTER_ASSERT(reporter, 1 == c_RTConfTestVariable);
SK_CONF_SET("test.utils.rtconf.testVariable", 2);
#ifdef SK_DEVELOPER
#ifdef SK_DEBUG
REPORTER_ASSERT(reporter, 2 == c_RTConfTestVariable);
#else // not SK_DEVELOPER
// Can not change RTConf variables in Release.
#else // not SK_DEBUG
// Can not change RTConf variables in SK_RELEASE.
REPORTER_ASSERT(reporter, 1 == c_RTConfTestVariable);
#endif // SK_DEVELOPER
#endif // SK_DEBUG
// This should not give a warning.
SK_CONF_TRY_SET("test.utils.rtconf.nonexistentVariable", 7);

View File

@ -45,12 +45,12 @@ static sk_sp<SkPicture> inspect(const char path[]) {
}
static void dumpOps(SkPicture* pic) {
#ifdef SK_DEVELOPER
#ifdef SK_DEBUG
SkDebugfDumper dumper;
SkDumpCanvas canvas(&dumper);
canvas.drawPicture(pic);
#else
printf("SK_DEVELOPER mode not enabled\n");
printf("SK_DEBUG mode not enabled\n");
#endif
}