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

Side by Side Diff: gm/shadows.cpp

Issue 1793303002: Reland of "more shader-->sp conversions (patchset #5 id:80001 of https://codereview.chromium… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: make pictureRef a value, so its clearer what's going on 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/shadertext3.cpp ('k') | gm/shallowgradient.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 2011 Google Inc. 2 * Copyright 2011 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 #include "SkBlurDrawLooper.h" 9 #include "SkBlurDrawLooper.h"
10 #include "SkBlurMask.h" 10 #include "SkBlurMask.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 canvas->translate(SkIntToScalar(0), SkIntToScalar(40)); 121 canvas->translate(SkIntToScalar(0), SkIntToScalar(40));
122 setup(&paint, gRec[2].fColor, gRec[2].fStrokeWidth); 122 setup(&paint, gRec[2].fColor, gRec[2].fStrokeWidth);
123 canvas->drawPath(fCirclePath, paint); 123 canvas->drawPath(fCirclePath, paint);
124 124
125 // see bug.skia.org/562 (reference, draws correct) 125 // see bug.skia.org/562 (reference, draws correct)
126 canvas->translate(0, 40); 126 canvas->translate(0, 40);
127 paint.setColor(SK_ColorBLACK); 127 paint.setColor(SK_ColorBLACK);
128 canvas->drawBitmap(fBitmap, 10, 10, &paint); 128 canvas->drawBitmap(fBitmap, 10, 10, &paint);
129 129
130 canvas->translate(0, 40); 130 canvas->translate(0, 40);
131 SkAutoTUnref<SkShader> shader(SkShader::CreateBitmapShader( 131 paint.setShader(SkShader::MakeBitmapShader(
132 fBitmap, SkShader::kRepeat_TileMode, 132 fBitmap, SkShader::kRepeat_TileMode,
133 SkShader::kRepeat_TileMode)); 133 SkShader::kRepeat_TileMode));
134 134
135 // see bug.skia.org/562 (shows bug as reported) 135 // see bug.skia.org/562 (shows bug as reported)
136 paint.setShader(shader);
137 paint.setStyle(SkPaint::kFill_Style); 136 paint.setStyle(SkPaint::kFill_Style);
138 canvas->drawRect(SkRect::MakeXYWH(10, 10, 20, 20), paint); 137 canvas->drawRect(SkRect::MakeXYWH(10, 10, 20, 20), paint);
139 paint.setShader(nullptr); 138 paint.setShader(nullptr);
140 } 139 }
141 } 140 }
142 141
143 private: 142 private:
144 typedef GM INHERITED; 143 typedef GM INHERITED;
145 }; 144 };
146 145
147 /////////////////////////////////////////////////////////////////////////////// 146 ///////////////////////////////////////////////////////////////////////////////
148 147
149 static GM* MyFactory(void*) { return new ShadowsGM; } 148 static GM* MyFactory(void*) { return new ShadowsGM; }
150 static GMRegistry reg(MyFactory); 149 static GMRegistry reg(MyFactory);
151 150
152 } 151 }
OLDNEW
« no previous file with comments | « gm/shadertext3.cpp ('k') | gm/shallowgradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698