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

Side by Side Diff: gm/bigmatrix.cpp

Issue 1776973003: partial switch over to sp usage of shaders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: move into lua container Created 4 years, 9 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 | « gm/aarectmodes.cpp ('k') | gm/bitmaprect.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 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gm.h" 8 #include "gm.h"
9 9
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 uint32_t* pixels = reinterpret_cast<uint32_t*>(bmp.getPixels()); 48 uint32_t* pixels = reinterpret_cast<uint32_t*>(bmp.getPixels());
49 pixels[0] = SkPackARGB32(0xFF, 0xFF, 0x00, 0x00); 49 pixels[0] = SkPackARGB32(0xFF, 0xFF, 0x00, 0x00);
50 pixels[1] = SkPackARGB32(0xFF, 0x00, 0xFF, 0x00); 50 pixels[1] = SkPackARGB32(0xFF, 0x00, 0xFF, 0x00);
51 pixels[2] = SkPackARGB32(0x80, 0x00, 0x00, 0x00); 51 pixels[2] = SkPackARGB32(0x80, 0x00, 0x00, 0x00);
52 pixels[3] = SkPackARGB32(0xFF, 0x00, 0x00, 0xFF); 52 pixels[3] = SkPackARGB32(0xFF, 0x00, 0x00, 0xFF);
53 pt.set(30 * SK_Scalar1, 30 * SK_Scalar1); 53 pt.set(30 * SK_Scalar1, 30 * SK_Scalar1);
54 m.mapPoints(&pt, 1); 54 m.mapPoints(&pt, 1);
55 SkMatrix s; 55 SkMatrix s;
56 s.reset(); 56 s.reset();
57 s.setScale(SK_Scalar1 / 1000, SK_Scalar1 / 1000); 57 s.setScale(SK_Scalar1 / 1000, SK_Scalar1 / 1000);
58 SkShader* shader = SkShader::CreateBitmapShader( 58 paint.setShader(SkShader::MakeBitmapShader(bmp, SkShader::kRepeat_TileMo de,
59 bmp, 59 SkShader::kRepeat_TileMode, & s));
60 SkShader::kRepeat_TileMode,
61 SkShader::kRepeat_TileMode,
62 &s);
63 paint.setShader(shader)->unref();
64 paint.setAntiAlias(false); 60 paint.setAntiAlias(false);
65 paint.setFilterQuality(kLow_SkFilterQuality); 61 paint.setFilterQuality(kLow_SkFilterQuality);
66 rect.setLTRB(pt.fX - small, pt.fY - small, 62 rect.setLTRB(pt.fX - small, pt.fY - small,
67 pt.fX + small, pt.fY + small); 63 pt.fX + small, pt.fY + small);
68 canvas->drawRect(rect, paint); 64 canvas->drawRect(rect, paint);
69 } 65 }
OLDNEW
« no previous file with comments | « gm/aarectmodes.cpp ('k') | gm/bitmaprect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698