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

Side by Side Diff: samplecode/SamplePatch.cpp

Issue 287063009: Revert of remove unused (by clients) SkUnitMapper (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 7 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/SampleLayers.cpp ('k') | samplecode/SampleShaderText.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 24 matching lines...) Expand all
35 size->set(bm.width(), bm.height()); 35 size->set(bm.width(), bm.height());
36 return SkShader::CreateBitmapShader(bm, SkShader::kClamp_TileMode, 36 return SkShader::CreateBitmapShader(bm, SkShader::kClamp_TileMode,
37 SkShader::kClamp_TileMode); 37 SkShader::kClamp_TileMode);
38 } 38 }
39 39
40 static SkShader* make_shader1(const SkIPoint& size) { 40 static SkShader* make_shader1(const SkIPoint& size) {
41 SkPoint pts[] = { { 0, 0, }, 41 SkPoint pts[] = { { 0, 0, },
42 { SkIntToScalar(size.fX), SkIntToScalar(size.fY) } }; 42 { SkIntToScalar(size.fX), SkIntToScalar(size.fY) } };
43 SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorRED } ; 43 SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorRED } ;
44 return SkGradientShader::CreateLinear(pts, colors, NULL, 44 return SkGradientShader::CreateLinear(pts, colors, NULL,
45 SK_ARRAY_COUNT(colors), SkShader::kMirror_TileMode); 45 SK_ARRAY_COUNT(colors), SkShader::kMirror_TileMode, NULL);
46 } 46 }
47 47
48 /////////////////////////////////////////////////////////////////////////////// 48 ///////////////////////////////////////////////////////////////////////////////
49 49
50 class Patch { 50 class Patch {
51 public: 51 public:
52 Patch() { sk_bzero(fPts, sizeof(fPts)); } 52 Patch() { sk_bzero(fPts, sizeof(fPts)); }
53 ~Patch() {} 53 ~Patch() {}
54 54
55 void setPatch(const SkPoint pts[12]) { 55 void setPatch(const SkPoint pts[12]) {
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 } 342 }
343 343
344 private: 344 private:
345 typedef SampleView INHERITED; 345 typedef SampleView INHERITED;
346 }; 346 };
347 347
348 ////////////////////////////////////////////////////////////////////////////// 348 //////////////////////////////////////////////////////////////////////////////
349 349
350 static SkView* MyFactory() { return new PatchView; } 350 static SkView* MyFactory() { return new PatchView; }
351 static SkViewRegister reg(MyFactory); 351 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleLayers.cpp ('k') | samplecode/SampleShaderText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698