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

Side by Side Diff: gm/shadows.cpp

Issue 1790353002: Revert of more shader-->sp conversions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 paint.setShader(SkShader::MakeBitmapShader( 131 SkAutoTUnref<SkShader> shader(SkShader::CreateBitmapShader(
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);
136 paint.setStyle(SkPaint::kFill_Style); 137 paint.setStyle(SkPaint::kFill_Style);
137 canvas->drawRect(SkRect::MakeXYWH(10, 10, 20, 20), paint); 138 canvas->drawRect(SkRect::MakeXYWH(10, 10, 20, 20), paint);
138 paint.setShader(nullptr); 139 paint.setShader(nullptr);
139 } 140 }
140 } 141 }
141 142
142 private: 143 private:
143 typedef GM INHERITED; 144 typedef GM INHERITED;
144 }; 145 };
145 146
146 /////////////////////////////////////////////////////////////////////////////// 147 ///////////////////////////////////////////////////////////////////////////////
147 148
148 static GM* MyFactory(void*) { return new ShadowsGM; } 149 static GM* MyFactory(void*) { return new ShadowsGM; }
149 static GMRegistry reg(MyFactory); 150 static GMRegistry reg(MyFactory);
150 151
151 } 152 }
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