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

Side by Side Diff: bench/DeferredSurfaceCopyBench.cpp

Issue 22385011: Removing deprecated constructors and setDevice from SkDeferredCanvas (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « bench/DeferredCanvasBench.cpp ('k') | bench/benchmain.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 /* 2 /*
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #if SK_SUPPORT_GPU 9 #if SK_SUPPORT_GPU
10 #include "GrRenderTarget.h" 10 #include "GrRenderTarget.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #if SK_SUPPORT_GPU 46 #if SK_SUPPORT_GPU
47 GrRenderTarget* rt = reinterpret_cast<GrRenderTarget*>( 47 GrRenderTarget* rt = reinterpret_cast<GrRenderTarget*>(
48 canvas->getDevice()->accessRenderTarget()); 48 canvas->getDevice()->accessRenderTarget());
49 if (NULL != rt) { 49 if (NULL != rt) {
50 surface = SkSurface::NewRenderTarget(rt->getContext(), info, rt->num Samples()); 50 surface = SkSurface::NewRenderTarget(rt->getContext(), info, rt->num Samples());
51 } else 51 } else
52 #endif 52 #endif
53 { 53 {
54 surface = SkSurface::NewRaster(info); 54 surface = SkSurface::NewRaster(info);
55 } 55 }
56 SkAutoTUnref<SkDeferredCanvas> drawingCanvas( 56 SkAutoTUnref<SkDeferredCanvas> drawingCanvas(SkDeferredCanvas::Create(su rface));
57 #if SK_DEFERRED_CANVAS_USES_FACTORIES
58 SkDeferredCanvas::Create(surface));
59 #else
60 SkNEW_ARGS(SkDeferredCanvas, (surface)));
61 #endif
62 surface->unref(); 57 surface->unref();
63 58
64 for (int iteration = 0; iteration < N; iteration++) { 59 for (int iteration = 0; iteration < N; iteration++) {
65 drawingCanvas->clear(0); 60 drawingCanvas->clear(0);
66 SkAutoTUnref<SkImage> image(drawingCanvas->newImageSnapshot()); 61 SkAutoTUnref<SkImage> image(drawingCanvas->newImageSnapshot());
67 SkPaint paint; 62 SkPaint paint;
68 if (!fDiscardableContents) { 63 if (!fDiscardableContents) {
69 // If paint is not opaque, prior canvas contents are 64 // If paint is not opaque, prior canvas contents are
70 // not discardable because they are needed for compositing. 65 // not discardable because they are needed for compositing.
71 paint.setAlpha(127); 66 paint.setAlpha(127);
(...skipping 10 matching lines...) Expand all
82 typedef SkBenchmark INHERITED; 77 typedef SkBenchmark INHERITED;
83 }; 78 };
84 79
85 ////////////////////////////////////////////////////////////////////////////// 80 //////////////////////////////////////////////////////////////////////////////
86 81
87 static SkBenchmark* Fact0(void* p) { return new DeferredSurfaceCopyBench(p, fals e); } 82 static SkBenchmark* Fact0(void* p) { return new DeferredSurfaceCopyBench(p, fals e); }
88 static SkBenchmark* Fact1(void* p) { return new DeferredSurfaceCopyBench(p, true ); } 83 static SkBenchmark* Fact1(void* p) { return new DeferredSurfaceCopyBench(p, true ); }
89 84
90 static BenchRegistry gReg0(Fact0); 85 static BenchRegistry gReg0(Fact0);
91 static BenchRegistry gReg1(Fact1); 86 static BenchRegistry gReg1(Fact1);
OLDNEW
« no previous file with comments | « bench/DeferredCanvasBench.cpp ('k') | bench/benchmain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698