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

Side by Side Diff: gm/recordopts.cpp

Issue 1831323003: Swap SkPictureImageFilter's factories over to smart pointers (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
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 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 canvas->drawRect(targetRect, shapePaint); 110 canvas->drawRect(targetRect, shapePaint);
111 shape = recorder.finishRecordingAsPicture(); 111 shape = recorder.finishRecordingAsPicture();
112 } 112 }
113 113
114 SkPaint layerPaint; 114 SkPaint layerPaint;
115 layerPaint.setColor(SkColorSetARGB(130, 0, 0, 0)); 115 layerPaint.setColor(SkColorSetARGB(130, 0, 0, 0));
116 canvas->saveLayer(&targetRect, &layerPaint); 116 canvas->saveLayer(&targetRect, &layerPaint);
117 canvas->save(); 117 canvas->save();
118 canvas->clipRect(targetRect); 118 canvas->clipRect(targetRect);
119 SkPaint drawPaint; 119 SkPaint drawPaint;
120 drawPaint.setImageFilter(SkPictureImageFilter::Create(shape.get()))- >unref(); 120 drawPaint.setImageFilter(SkPictureImageFilter::Make(shape));
121 installDetector(&drawPaint); 121 installDetector(&drawPaint);
122 canvas->saveLayer(&targetRect, &drawPaint); 122 canvas->saveLayer(&targetRect, &drawPaint);
123 canvas->restore(); 123 canvas->restore();
124 canvas->restore(); 124 canvas->restore();
125 canvas->restore(); 125 canvas->restore();
126 } 126 }
127 127
128 // Draws two columns of rectangles. The test is correct when: 128 // Draws two columns of rectangles. The test is correct when:
129 // - Left and right columns always identical 129 // - Left and right columns always identical
130 // - First 3 rows are green, with a white dent in the middle row 130 // - First 3 rows are green, with a white dent in the middle row
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } 207 }
208 208
209 canvas->restore(); 209 canvas->restore();
210 canvas->translate(SkIntToScalar(0), SkIntToScalar(kTestRectSize) + SkIntToScalar(1)); 210 canvas->translate(SkIntToScalar(0), SkIntToScalar(kTestRectSize) + SkIntToScalar(1));
211 } 211 }
212 212
213 } 213 }
214 } 214 }
215 } 215 }
216 216
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698