Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(768)

Side by Side Diff: samplecode/SampleBox.cpp

Issue 1634683006: remove unused sample (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
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 "SkView.h"
10 #include "SkCanvas.h"
11
12 class SimpleView : public SampleView {
13 public:
14 SimpleView() {
15 this->setBGColor(0xFFDDDDDD);
16 }
17
18 protected:
19 // overrides from SkEventSink
20 virtual bool onQuery(SkEvent* evt) {
21 if (SampleCode::TitleQ(*evt)) {
22 SampleCode::TitleR(evt, "Box Gradient");
23 return true;
24 }
25 return this->INHERITED::onQuery(evt);
26 }
27
28 virtual void onDrawContent(SkCanvas* canvas) {
29 SkPaint paint;
30 paint.setAntiAlias(true);
31 paint.setStyle(SkPaint::kStroke_Style);
32 paint.setStrokeWidth(SkScalarHalf(SkIntToScalar(3)));
33 paint.setStyle(SkPaint::kFill_Style);
34
35 SkRect r;
36 SkScalar x,y;
37 x = 10;
38 y = 10;
39
40 r.set(x, y, x + SkIntToScalar(100), y + SkIntToScalar(100));
41 for (int i = 0; i < 256; ++i) {
42 canvas->translate(1, 1);
43 paint.setColor(0xFF000000 + i * 0x00010000);
44 canvas->drawRect(r, paint);
45 }
46 }
47
48 private:
49 typedef SampleView INHERITED;
50 };
51
52 //////////////////////////////////////////////////////////////////////////////
53
54 static SkView* MyFactory() { return new SimpleView; }
55 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698