2011-07-28 14:26:00 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2011 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
2011-03-18 21:43:03 +00:00
|
|
|
#include "SampleCode.h"
|
2011-03-15 15:15:15 +00:00
|
|
|
#include "SkCanvas.h"
|
|
|
|
#include "SkColor.h"
|
2011-03-18 21:43:03 +00:00
|
|
|
#include "SkEvent.h"
|
2011-03-15 15:15:15 +00:00
|
|
|
#include "SkView.h"
|
|
|
|
|
|
|
|
class DrawBlue : public SkView {
|
|
|
|
|
|
|
|
public:
|
|
|
|
DrawBlue() {}
|
|
|
|
protected:
|
|
|
|
virtual void onDraw(SkCanvas* canvas) {
|
|
|
|
canvas->drawColor(SK_ColorBLUE);
|
|
|
|
}
|
2011-03-18 21:43:03 +00:00
|
|
|
virtual bool onQuery(SkEvent* evt) {
|
|
|
|
if (SampleCode::TitleQ(*evt)) {
|
|
|
|
SampleCode::TitleR(evt, "DrawBlue");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return this->INHERITED::onQuery(evt);
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
typedef SkView INHERITED;
|
2011-03-15 15:15:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static SkView* MyFactory() { return new DrawBlue; }
|
|
|
|
static SkViewRegister reg(MyFactory);
|