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

Side by Side Diff: samplecode/SampleCircle.cpp

Issue 22978012: Split SkDevice into SkBaseDevice and SkBitmapDevice (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Updating to ToT (10994) Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | samplecode/SampleTextureDomain.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 canvas->save(); 67 canvas->save();
68 circle(canvas, width, false); 68 circle(canvas, width, false);
69 canvas->translate(0, dy); 69 canvas->translate(0, dy);
70 circle(canvas, width, true); 70 circle(canvas, width, true);
71 canvas->restore(); 71 canvas->restore();
72 canvas->translate(dx, 0); 72 canvas->translate(dx, 0);
73 } 73 }
74 } 74 }
75 75
76 static void blowup(SkCanvas* canvas, const SkIRect& src, const SkRect& dst) { 76 static void blowup(SkCanvas* canvas, const SkIRect& src, const SkRect& dst) {
77 SkDevice* device = canvas->getDevice(); 77 SkBaseDevice* device = canvas->getDevice();
78 const SkBitmap& bm = device->accessBitmap(false); 78 const SkBitmap& bm = device->accessBitmap(false);
79 canvas->drawBitmapRect(bm, &src, dst, NULL); 79 canvas->drawBitmapRect(bm, &src, dst, NULL);
80 } 80 }
81 81
82 static void make_poly(SkPath* path, int n) { 82 static void make_poly(SkPath* path, int n) {
83 if (n <= 0) { 83 if (n <= 0) {
84 return; 84 return;
85 } 85 }
86 path->incReserve(n + 1); 86 path->incReserve(n + 1);
87 path->moveTo(SK_Scalar1, 0); 87 path->moveTo(SK_Scalar1, 0);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 }; 126 };
127 127
128 const SkScalar CircleView::ANIM_DX(SK_Scalar1 / 67); 128 const SkScalar CircleView::ANIM_DX(SK_Scalar1 / 67);
129 const SkScalar CircleView::ANIM_DY(SK_Scalar1 / 29); 129 const SkScalar CircleView::ANIM_DY(SK_Scalar1 / 29);
130 const SkScalar CircleView::ANIM_RAD(SK_Scalar1 / 19); 130 const SkScalar CircleView::ANIM_RAD(SK_Scalar1 / 19);
131 131
132 ////////////////////////////////////////////////////////////////////////////// 132 //////////////////////////////////////////////////////////////////////////////
133 133
134 static SkView* MyFactory() { return new CircleView; } 134 static SkView* MyFactory() { return new CircleView; }
135 static SkViewRegister reg(MyFactory); 135 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | samplecode/SampleTextureDomain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698