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

Side by Side Diff: bench/SKPBench.cpp

Issue 1810813003: update callsites for Make image factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: start to take advantage of sk_sp drawImage 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 | « bench/PDFBench.cpp ('k') | bench/SkLinearBitmapPipelineBench.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 "SKPBench.h" 8 #include "SKPBench.h"
9 #include "SkCommandLineFlags.h" 9 #include "SkCommandLineFlags.h"
10 #include "SkMultiPictureDraw.h" 10 #include "SkMultiPictureDraw.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 fSurfaces.top()->getCanvas()->setMatrix(canvas->getTotalMatrix()); 83 fSurfaces.top()->getCanvas()->setMatrix(canvas->getTotalMatrix());
84 fSurfaces.top()->getCanvas()->scale(fScale, fScale); 84 fSurfaces.top()->getCanvas()->scale(fScale, fScale);
85 } 85 }
86 } 86 }
87 } 87 }
88 88
89 void SKPBench::onPerCanvasPostDraw(SkCanvas* canvas) { 89 void SKPBench::onPerCanvasPostDraw(SkCanvas* canvas) {
90 // Draw the last set of tiles into the master canvas in case we're 90 // Draw the last set of tiles into the master canvas in case we're
91 // saving the images 91 // saving the images
92 for (int i = 0; i < fTileRects.count(); ++i) { 92 for (int i = 0; i < fTileRects.count(); ++i) {
93 SkAutoTUnref<SkImage> image(fSurfaces[i]->newImageSnapshot()); 93 sk_sp<SkImage> image(fSurfaces[i]->makeImageSnapshot());
94 canvas->drawImage(image, 94 canvas->drawImage(image,
95 SkIntToScalar(fTileRects[i].fLeft), SkIntToScalar(fTil eRects[i].fTop)); 95 SkIntToScalar(fTileRects[i].fLeft), SkIntToScalar(fTil eRects[i].fTop));
96 SkSafeSetNull(fSurfaces[i]); 96 SkSafeSetNull(fSurfaces[i]);
97 } 97 }
98 98
99 fSurfaces.rewind(); 99 fSurfaces.rewind();
100 fTileRects.rewind(); 100 fTileRects.rewind();
101 } 101 }
102 102
103 bool SKPBench::isSuitableFor(Backend backend) { 103 bool SKPBench::isSuitableFor(Backend backend) {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 context->freeGpuResources(); 190 context->freeGpuResources();
191 context->resetContext(); 191 context->resetContext();
192 context->getGpu()->resetShaderCacheForTesting(); 192 context->getGpu()->resetShaderCacheForTesting();
193 draw_pic_for_stats(canvas, context, fPic, keys, values, "first_frame"); 193 draw_pic_for_stats(canvas, context, fPic, keys, values, "first_frame");
194 194
195 // draw second frame 195 // draw second frame
196 draw_pic_for_stats(canvas, context, fPic, keys, values, "second_frame"); 196 draw_pic_for_stats(canvas, context, fPic, keys, values, "second_frame");
197 197
198 #endif 198 #endif
199 } 199 }
OLDNEW
« no previous file with comments | « bench/PDFBench.cpp ('k') | bench/SkLinearBitmapPipelineBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698