blob: 83e6fd5eaba5930fc5309415fb48c7095afff939 [file] [log] [blame]
epoger@google.com5aab3402012-03-22 15:15:07 +00001
2/*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8#include "SampleCode.h"
9#include "SkCanvas.h"
10#include "SkColor.h"
11#include "SkEvent.h"
12#include "SkView.h"
13
14class DrawBlue : public SkView {
15
16public:
17 DrawBlue() {}
18protected:
19 virtual void onDraw(SkCanvas* canvas) {
20 canvas->drawColor(SK_ColorBLUE);
21 }
22 virtual bool onQuery(SkEvent* evt) {
23 if (SampleCode::TitleQ(*evt)) {
24 SampleCode::TitleR(evt, "DrawBlue");
25 return true;
26 }
27 return this->INHERITED::onQuery(evt);
28 }
29private:
30 typedef SkView INHERITED;
31};
32
33static SkView* MyFactory() { return new DrawBlue; }
34static SkViewRegister reg(MyFactory);