remove defines for strcasecmp (issue #5)

support setMatrix in pictures



git-svn-id: http://skia.googlecode.com/svn/trunk@53 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@android.com 2009-01-06 15:03:30 +00:00
parent bd700c391d
commit 6e073b9e2b
5 changed files with 13 additions and 8 deletions

View File

@ -98,14 +98,6 @@
#ifndef SK_DEBUGBREAK
#define SK_DEBUGBREAK(cond) do { if (!(cond)) DebugBreak(); } while (false)
#endif
#ifdef SK_BUILD_FOR_WIN32
#define strcasecmp(a, b) stricmp(a, b)
#define strncasecmp(a, b, c) strnicmp(a, b, c)
#elif defined(SK_BUILD_FOR_WINCE)
#define strcasecmp(a, b) _stricmp(a, b)
#define strncasecmp(a, b, c) _strnicmp(a, b, c)
#endif
#elif defined(SK_BUILD_FOR_MAC)
#ifndef SK_DEBUGBREAK
#define SK_DEBUGBREAK(cond) do { if (!(cond)) SK_CRASH(); } while (false)

View File

@ -36,6 +36,7 @@ enum DrawType {
SAVE,
SAVE_LAYER,
SCALE,
SET_MATRIX,
SKEW,
TRANSLATE
};

View File

@ -653,6 +653,9 @@ void SkPicturePlayback::draw(SkCanvas& canvas) {
SkScalar sy = getScalar();
canvas.scale(sx, sy);
} break;
case SET_MATRIX:
canvas.setMatrix(*getMatrix());
break;
case SKEW: {
SkScalar sx = getScalar();
SkScalar sy = getScalar();

View File

@ -105,6 +105,14 @@ bool SkPictureRecord::concat(const SkMatrix& matrix) {
return this->INHERITED::concat(matrix);
}
void SkPictureRecord::setMatrix(const SkMatrix& matrix) {
validate();
addDraw(SET_MATRIX);
addMatrix(matrix);
validate();
this->INHERITED::setMatrix(matrix);
}
bool SkPictureRecord::clipRect(const SkRect& rect, SkRegion::Op op) {
addDraw(CLIP_RECT);
addRect(rect);

View File

@ -23,6 +23,7 @@ public:
virtual bool rotate(SkScalar degrees);
virtual bool skew(SkScalar sx, SkScalar sy);
virtual bool concat(const SkMatrix& matrix);
virtual void setMatrix(const SkMatrix& matrix);
virtual bool clipRect(const SkRect& rect, SkRegion::Op op);
virtual bool clipPath(const SkPath& path, SkRegion::Op op);
virtual bool clipRegion(const SkRegion& region, SkRegion::Op op);