skia2/unix_test_app/DrawBlueSample.cpp
scroggo b66365f5dd Updates to the unix sample app.
Rather than placing pixels, use XPutImage to place the bitmap on screen.

Modify the color arrangements for 8888 when building the sample app, so
they agree with X.

Add a title to simple sample.

Include SkTouchGesture.



git-svn-id: http://skia.googlecode.com/svn/trunk@963 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-03-18 21:43:03 +00:00

28 lines
622 B
C++

#include "SampleCode.h"
#include "SkCanvas.h"
#include "SkColor.h"
#include "SkEvent.h"
#include "SkView.h"
class DrawBlue : public SkView {
public:
DrawBlue() {}
protected:
virtual void onDraw(SkCanvas* canvas) {
canvas->drawColor(SK_ColorBLUE);
}
virtual bool onQuery(SkEvent* evt) {
if (SampleCode::TitleQ(*evt)) {
SampleCode::TitleR(evt, "DrawBlue");
return true;
}
return this->INHERITED::onQuery(evt);
}
private:
typedef SkView INHERITED;
};
static SkView* MyFactory() { return new DrawBlue; }
static SkViewRegister reg(MyFactory);