struct SkRect;
class SkPath;
-#define SK_DefaultStrokeWidth SK_Scalar1
-#define SK_DefaultMiterLimit SkIntToScalar(4)
-
-
/** \class SkStroke
SkStroke is the utility class that constructs paths by stroking
geometries (lines, rects, ovals, roundrects, paths). This is
#include "SkXfermode.h"
#include "SkAutoKern.h"
#include "SkGlyphCache.h"
+#include "SkPaintDefaults.h"
// define this to get a printf for out-of-range parameter in setters
// e.g. setTextSize(-1)
//#define SK_REPORT_API_RANGE_CHECK
-#define SK_DefaultTextSize SkIntToScalar(12)
-
-#define SK_DefaultFlags 0 //(kNativeHintsText_Flag)
-
#ifdef SK_BUILD_FOR_ANDROID
#define GEN_ID_INC fGenerationID++
#define GEN_ID_INC_EVAL(expression) if (expression) { fGenerationID++; }
fWidth = 0;
#endif
- fTextSize = SK_DefaultTextSize;
+ fTextSize = SkPaintDefaults_TextSize;
fTextScaleX = SK_Scalar1;
fColor = SK_ColorBLACK;
- fMiterLimit = SK_DefaultMiterLimit;
- fFlags = SK_DefaultFlags;
+ fMiterLimit = SkPaintDefaults_MiterLimit;
+ fFlags = SkPaintDefaults_Flags;
fCapType = kDefault_Cap;
fJoinType = kDefault_Join;
fTextAlign = kLeft_Align;
fStyle = kFill_Style;
fTextEncoding = kUTF8_TextEncoding;
- fHinting = kNormal_Hinting;
+ fHinting = SkPaintDefaults_Hinting;
#ifdef SK_BUILD_FOR_ANDROID
fGenerationID = 0;
#endif
--- /dev/null
+/*
+ * Copyright 2012 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkPaintDefaults_DEFINED
+#define SkPaintDefaults_DEFINED
+
+#include "SkPaint.h"
+
+/**
+ * Any of these can be specified by the build system (or SkUserConfig.h)
+ * to change the default values for a SkPaint. This file should not be
+ * edited directly.
+ */
+
+#ifndef SkPaintDefaults_Flags
+ #define SkPaintDefaults_Flags 0
+#endif
+
+#ifndef SkPaintDefaults_TextSize
+ #define SkPaintDefaults_TextSize SkIntToScalar(12)
+#endif
+
+#ifndef SkPaintDefaults_Hinting
+ #define SkPaintDefaults_Hinting SkPaint::kNormal_Hinting
+#endif
+
+#ifndef SkPaintDefaults_MiterLimit
+ #define SkPaintDefaults_MiterLimit SkIntToScalar(4)
+#endif
+
+#endif
: fWidth(width), fMiter(miter), fStyle(SkToU8(style)),
fJoin(SkToU8(join)), fCap(SkToU8(cap)) {
if (miter < 0) { // signal they want the default
- fMiter = SK_DefaultMiterLimit;
+ fMiter = SkIntToScalar(4);
}
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
-#include "SkPaint.h"
+#include "SkPaintDefaults.h"
SkStroke::SkStroke() {
- fWidth = SK_DefaultStrokeWidth;
- fMiterLimit = SK_DefaultMiterLimit;
+ fWidth = SK_Scalar1;
+ fMiterLimit = SkPaintDefaults_MiterLimit;
fCap = SkPaint::kDefault_Cap;
fJoin = SkPaint::kDefault_Join;
fDoFill = false;