From: reed@google.com Date: Wed, 2 Mar 2011 14:34:11 +0000 (+0000) Subject: #ifdef protect win specific code (e.g. LOGFONT) X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~18902 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d6f5a81955d0edb5bec9198bcadeab9563340927;p=platform%2Fupstream%2FlibSkiaSharp.git #ifdef protect win specific code (e.g. LOGFONT) git-svn-id: http://skia.googlecode.com/svn/trunk@874 2bbb7eff-a529-9590-31e7-b0007b416f81 --- diff --git a/samplecode/SampleTextBox.cpp b/samplecode/SampleTextBox.cpp index 9511914..f2b5e2c 100644 --- a/samplecode/SampleTextBox.cpp +++ b/samplecode/SampleTextBox.cpp @@ -20,9 +20,11 @@ #include "SkStream.h" #include "SkKey.h" +#ifdef SK_BUILD_FOR_WIN extern SkTypeface* SkCreateTypefaceFromLOGFONT(const LOGFONT&); +#endif -static const char gText[] = +static const char gText[] = "When in the Course of human events it becomes necessary for one people " "to dissolve the political bands which have connected them with another " "and to assume among the powers of the earth, the separate and equal " @@ -31,8 +33,9 @@ static const char gText[] = "declare the causes which impel them to the separation."; class TextBoxView : public SkView { -public: +public: TextBoxView() { +#ifdef SK_BUILD_FOR_WIN LOGFONT lf; sk_bzero(&lf, sizeof(lf)); lf.lfHeight = 9; @@ -43,8 +46,9 @@ public: SkASSERT(tf0 == tf1); tf0->unref(); tf1->unref(); +#endif } - + protected: // overrides from SkEventSink virtual bool onQuery(SkEvent* evt) { @@ -55,11 +59,11 @@ protected: } return this->INHERITED::onQuery(evt); } - + void drawBG(SkCanvas* canvas) { canvas->drawColor(SK_ColorWHITE); } - + virtual void onDraw(SkCanvas* canvas) { this->drawBG(canvas); @@ -80,7 +84,7 @@ protected: canvas->translate(0, tbox.getTextHeight() + paint.getFontSpacing()); } } - + private: typedef SkView INHERITED; };