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

Side by Side Diff: bench/ImageFilterCollapse.cpp

Issue 1019493002: Remove uniqueID from all filter serialization. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Null out fUniqueID deserialization Created 5 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 | « no previous file | gm/dropshadowimagefilter.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 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 "Benchmark.h" 8 #include "Benchmark.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 15 matching lines...) Expand all
26 ~BaseImageFilterCollapseBench() { 26 ~BaseImageFilterCollapseBench() {
27 SkSafeUnref(fImageFilter); 27 SkSafeUnref(fImageFilter);
28 } 28 }
29 29
30 protected: 30 protected:
31 void doPreDraw(SkColorFilter* colorFilters[], int nFilters) { 31 void doPreDraw(SkColorFilter* colorFilters[], int nFilters) {
32 // Create a chain of ImageFilters from colorFilters 32 // Create a chain of ImageFilters from colorFilters
33 fImageFilter = NULL; 33 fImageFilter = NULL;
34 for(int i = nFilters; i --> 0;) { 34 for(int i = nFilters; i --> 0;) {
35 SkAutoTUnref<SkImageFilter> filter( 35 SkAutoTUnref<SkImageFilter> filter(
36 SkColorFilterImageFilter::Create(colorFilters[i], fImage Filter, NULL, 0) 36 SkColorFilterImageFilter::Create(colorFilters[i], fImage Filter, NULL)
37 ); 37 );
38 SkRefCnt_SafeAssign(fImageFilter, filter.get()); 38 SkRefCnt_SafeAssign(fImageFilter, filter.get());
39 } 39 }
40 } 40 }
41 41
42 void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE { 42 void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE {
43 makeBitmap(); 43 makeBitmap();
44 44
45 for(int i = 0; i < loops; i++) { 45 for(int i = 0; i < loops; i++) {
46 SkPaint paint; 46 SkPaint paint;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 doPreDraw(colorFilters, SK_ARRAY_COUNT(colorFilters)); 149 doPreDraw(colorFilters, SK_ARRAY_COUNT(colorFilters));
150 150
151 for(unsigned i = 0; i < SK_ARRAY_COUNT(colorFilters); i++) { 151 for(unsigned i = 0; i < SK_ARRAY_COUNT(colorFilters); i++) {
152 colorFilters[i]->unref(); 152 colorFilters[i]->unref();
153 } 153 }
154 } 154 }
155 }; 155 };
156 156
157 DEF_BENCH(return new TableCollapseBench;) 157 DEF_BENCH(return new TableCollapseBench;)
158 DEF_BENCH(return new MatrixCollapseBench;) 158 DEF_BENCH(return new MatrixCollapseBench;)
OLDNEW
« no previous file with comments | « no previous file | gm/dropshadowimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698