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

Side by Side Diff: gm/pictureshadertile.cpp

Issue 513983002: Try out scalar picture sizes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT again Created 6 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
« no previous file with comments | « gm/pictureshader.cpp ('k') | gyp/skia_for_android_framework_defines.gypi » ('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 2014 Google Inc. 2 * Copyright 2014 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 "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 { 0, 0, 1, 0.5f, 0, 0 }, 55 { 0, 0, 1, 0.5f, 0, 0 },
56 { -0.25f, -0.25f, 1, 0.5f, 0, 0 }, 56 { -0.25f, -0.25f, 1, 0.5f, 0, 0 },
57 { 0.25f, 0.25f, 1, 0.5f, 0, 0 }, 57 { 0.25f, 0.25f, 1, 0.5f, 0, 0 },
58 }; 58 };
59 59
60 class PictureShaderTileGM : public skiagm::GM { 60 class PictureShaderTileGM : public skiagm::GM {
61 public: 61 public:
62 PictureShaderTileGM() { 62 PictureShaderTileGM() {
63 SkPictureRecorder recorder; 63 SkPictureRecorder recorder;
64 SkCanvas* pictureCanvas = recorder.beginRecording(SkScalarCeilToInt(kPic tureSize), 64 SkCanvas* pictureCanvas = recorder.beginRecording(kPictureSize, kPicture Size, NULL, 0);
65 SkScalarCeilToInt(kPic tureSize),
66 NULL, 0);
67 drawScene(pictureCanvas, kPictureSize); 65 drawScene(pictureCanvas, kPictureSize);
68 SkAutoTUnref<SkPicture> picture(recorder.endRecording()); 66 SkAutoTUnref<SkPicture> picture(recorder.endRecording());
69 67
70 for (unsigned i = 0; i < SK_ARRAY_COUNT(tiles); ++i) { 68 for (unsigned i = 0; i < SK_ARRAY_COUNT(tiles); ++i) {
71 SkRect tile = SkRect::MakeXYWH(tiles[i].x * kPictureSize, 69 SkRect tile = SkRect::MakeXYWH(tiles[i].x * kPictureSize,
72 tiles[i].y * kPictureSize, 70 tiles[i].y * kPictureSize,
73 tiles[i].w * kPictureSize, 71 tiles[i].w * kPictureSize,
74 tiles[i].h * kPictureSize); 72 tiles[i].h * kPictureSize);
75 SkMatrix localMatrix; 73 SkMatrix localMatrix;
76 localMatrix.setTranslate(tiles[i].offsetX * kPictureSize, 74 localMatrix.setTranslate(tiles[i].offsetX * kPictureSize,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 paint.setStyle(SkPaint::kStroke_Style); 136 paint.setStyle(SkPaint::kStroke_Style);
139 canvas->drawRect(SkRect::MakeWH(pictureSize, pictureSize), paint); 137 canvas->drawRect(SkRect::MakeWH(pictureSize, pictureSize), paint);
140 } 138 }
141 139
142 SkAutoTUnref<SkShader> fShaders[SK_ARRAY_COUNT(tiles)]; 140 SkAutoTUnref<SkShader> fShaders[SK_ARRAY_COUNT(tiles)];
143 141
144 typedef GM INHERITED; 142 typedef GM INHERITED;
145 }; 143 };
146 144
147 DEF_GM( return SkNEW(PictureShaderTileGM); ) 145 DEF_GM( return SkNEW(PictureShaderTileGM); )
OLDNEW
« no previous file with comments | « gm/pictureshader.cpp ('k') | gyp/skia_for_android_framework_defines.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698