summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Chromium Automerger <chromium-automerger@android>2014-05-01 18:37:53 +0000
committerAndroid Chromium Automerger <chromium-automerger@android>2014-05-01 18:37:53 +0000
commit0ffbc548eea1f2bace29697d3e9040a9f8daa521 (patch)
tree9e771907e9ca1e5c2d19e8fdc92769ef83b601b3
parentfad7d51df7e53b3ff30c0842150288e4b4f3f107 (diff)
parent3fb4cc8c3b7c3f77245eefef9691f207615938e1 (diff)
downloadinclude-0ffbc548eea1f2bace29697d3e9040a9f8daa521.tar.gz
Merge third_party/skia/include from https://chromium.googlesource.com/external/skia/include.git at 3fb4cc8c3b7c3f77245eefef9691f207615938e1
This commit was generated by merge_from_chromium.py. Change-Id: I4fed3a641666e9c79244c61c9f597111bf41cb88
-rw-r--r--core/SkPostConfig.h10
-rw-r--r--core/SkShader.h10
-rw-r--r--core/SkTypes.h4
-rw-r--r--gpu/GrColor.h2
-rw-r--r--gpu/GrConfig.h9
-rw-r--r--gpu/GrContextFactory.h2
-rw-r--r--gpu/GrTypesPriv.h2
7 files changed, 19 insertions, 20 deletions
diff --git a/core/SkPostConfig.h b/core/SkPostConfig.h
index bee87e6..88a2bfc 100644
--- a/core/SkPostConfig.h
+++ b/core/SkPostConfig.h
@@ -154,8 +154,8 @@
# undef NOMINMAX
# endif
#
-# ifndef SK_DEBUGBREAK
-# define SK_DEBUGBREAK(p) do { if (!(p)) { SkNO_RETURN_HINT(); __debugbreak(); }} while (false)
+# ifndef SK_ALWAYSBREAK
+# define SK_ALWAYSBREAK(p) do { if (!(p)) { SkNO_RETURN_HINT(); __debugbreak(); }} while (false)
# endif
#
# ifndef SK_A32_SHIFT
@@ -166,14 +166,14 @@
# endif
#
#else
-# ifndef SK_DEBUGBREAK
+# ifndef SK_ALWAYSBREAK
# ifdef SK_DEBUG
# include <stdio.h>
-# define SK_DEBUGBREAK(cond) do { if (cond) break; \
+# define SK_ALWAYSBREAK(cond) do { if (cond) break; \
SkDebugf("%s:%d: failed assertion \"%s\"\n", \
__FILE__, __LINE__, #cond); SK_CRASH(); } while (false)
# else
-# define SK_DEBUGBREAK(cond) do { if (cond) break; SK_CRASH(); } while (false)
+# define SK_ALWAYSBREAK(cond) do { if (cond) break; SK_CRASH(); } while (false)
# endif
# endif
#endif
diff --git a/core/SkShader.h b/core/SkShader.h
index 4af8f78..b0a7fd9 100644
--- a/core/SkShader.h
+++ b/core/SkShader.h
@@ -207,16 +207,22 @@ public:
* Create the actual object that does the shading.
* Returns NULL if validContext() returns false.
* Size of storage must be >= contextSize.
+ * Your subclass must also override contextSize() if it overrides createContext().
+ *
+ * Base class implementation returns NULL.
*/
virtual Context* createContext(const SkBitmap& device,
const SkPaint& paint,
const SkMatrix& matrix,
- void* storage) const = 0;
+ void* storage) const;
/**
* Return the size of a Context returned by createContext.
+ *
+ * Override this if your subclass overrides createContext, to return the correct size of
+ * your subclass' context.
*/
- virtual size_t contextSize() const = 0;
+ virtual size_t contextSize() const;
/**
* Helper to check the flags to know if it is legal to call shadeSpan16()
diff --git a/core/SkTypes.h b/core/SkTypes.h
index 13450cd..15de8a4 100644
--- a/core/SkTypes.h
+++ b/core/SkTypes.h
@@ -93,7 +93,7 @@ inline void operator delete(void* p) {
#endif
#ifdef SK_DEBUG
- #define SkASSERT(cond) SK_DEBUGBREAK(cond)
+ #define SkASSERT(cond) SK_ALWAYSBREAK(cond)
#define SkDEBUGFAIL(message) SkASSERT(false && message)
#define SkDEBUGCODE(code) code
#define SkDECLAREPARAM(type, var) , type var
@@ -113,6 +113,8 @@ inline void operator delete(void* p) {
#define SkAssertResult(cond) cond
#endif
+#define SkFAIL(message) SK_ALWAYSBREAK(false && message)
+
#ifdef SK_DEVELOPER
#define SkDEVCODE(code) code
#else
diff --git a/gpu/GrColor.h b/gpu/GrColor.h
index b0bce3f..183781a 100644
--- a/gpu/GrColor.h
+++ b/gpu/GrColor.h
@@ -117,7 +117,7 @@ static inline char GrColorComponentFlagToChar(GrColorComponentFlags component) {
case kA_GrColorComponentFlag:
return 'a';
default:
- GrCrash("Invalid color component flag.");
+ SkFAIL("Invalid color component flag.");
return '\0';
}
}
diff --git a/gpu/GrConfig.h b/gpu/GrConfig.h
index fc464c5..cbdb350 100644
--- a/gpu/GrConfig.h
+++ b/gpu/GrConfig.h
@@ -178,15 +178,6 @@ typedef unsigned __int64 uint64_t;
#define GrAlwaysAssert(COND) GR_ALWAYSASSERT(COND)
/**
- * Crash from unrecoverable condition, optionally with a message. The debug variants only
- * crash in a debug build. The message versions print the message regardless of release vs debug.
- */
-inline void GrCrash() { GrAlwaysAssert(false); }
-inline void GrCrash(const char* msg) { GrPrintf(msg); GrAlwaysAssert(false); }
-inline void GrDebugCrash() { SkASSERT(false); }
-inline void GrDebugCrash(const char* msg) { GrPrintf(msg); SkASSERT(false); }
-
-/**
* GR_STATIC_ASSERT is a compile time assertion. Depending on the platform
* it may print the message in the compiler log. Obviously, the condition must
* be evaluatable at compile time.
diff --git a/gpu/GrContextFactory.h b/gpu/GrContextFactory.h
index 916d5df..f09bad9 100644
--- a/gpu/GrContextFactory.h
+++ b/gpu/GrContextFactory.h
@@ -84,7 +84,7 @@ public:
case kDebug_GLContextType:
return "debug";
default:
- GrCrash("Unknown GL Context type.");
+ SkFAIL("Unknown GL Context type.");
}
}
diff --git a/gpu/GrTypesPriv.h b/gpu/GrTypesPriv.h
index f09f95d..dfe4153 100644
--- a/gpu/GrTypesPriv.h
+++ b/gpu/GrTypesPriv.h
@@ -212,7 +212,7 @@ static inline GrEffectEdgeType GrInvertEffectEdgeType(const GrEffectEdgeType edg
case kInverseFillAA_GrEffectEdgeType:
return kFillAA_GrEffectEdgeType;
case kHairlineAA_GrEffectEdgeType:
- GrCrash("Hairline fill isn't invertible.");
+ SkFAIL("Hairline fill isn't invertible.");
}
return kFillAA_GrEffectEdgeType; // suppress warning.
}