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

Side by Side Diff: bench/nanobenchAndroid.cpp

Issue 1407053009: Simplify linkages to Android framework internals (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: One gyp file is much like another Created 5 years, 1 month 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/nanobenchAndroid.h ('k') | dm/DMSrcSinkAndroid.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 2015 Google Inc. 2 * Copyright 2015 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 "nanobenchAndroid.h" 8 #include "nanobenchAndroid.h"
9 9
10 #include "AnimationContext.h"
11 #include "IContextFactory.h"
12 #include "SkiaCanvasProxy.h"
13 #include "android/rect.h"
14 #include "android/native_window.h"
15 #include "renderthread/TimeLord.h"
16
17 /* These functions are only compiled in the Android Framework. */ 10 /* These functions are only compiled in the Android Framework. */
18 11
19 HWUITarget::HWUITarget(const Config& c, Benchmark* bench) : Target(c) { } 12 HWUITarget::HWUITarget(const Config& c, Benchmark* bench) : Target(c) { }
20 13
21 void HWUITarget::setup() { 14 void HWUITarget::setup() {
22 this->renderer.proxy->fence(); 15 this->renderer.fence();
23 } 16 }
24 17
25 SkCanvas* HWUITarget::beginTiming(SkCanvas* canvas) { 18 SkCanvas* HWUITarget::beginTiming(SkCanvas* canvas) {
26 SkCanvas* targetCanvas = this->renderer.prepareToDraw(); 19 SkCanvas* targetCanvas = this->renderer.prepareToDraw();
27 if (targetCanvas) { 20 if (targetCanvas) {
28 this->fc.reset(targetCanvas); 21 this->fc.reset(targetCanvas);
29 canvas = &this->fc; 22 canvas = &this->fc;
30 // This might minimally distort timing, but canvas isn't valid outside t he timer. 23 // This might minimally distort timing, but canvas isn't valid outside t he timer.
31 canvas->clear(SK_ColorWHITE); 24 canvas->clear(SK_ColorWHITE);
32 } 25 }
33 26
34 return canvas; 27 return canvas;
35 } 28 }
36 29
37 void HWUITarget::endTiming() { 30 void HWUITarget::endTiming() {
38 this->renderer.finishDrawing(); 31 this->renderer.finishDrawing();
39 } 32 }
40 33
41 void HWUITarget::fence() { 34 void HWUITarget::fence() {
42 this->renderer.proxy->fence(); 35 this->renderer.fence();
43 } 36 }
44 37
45 bool HWUITarget::needsFrameTiming(int* frameLag) const { 38 bool HWUITarget::needsFrameTiming(int* frameLag) const {
46 extern int FLAGS_gpuFrameLag; 39 extern int FLAGS_gpuFrameLag;
47 *frameLag = FLAGS_gpuFrameLag; 40 *frameLag = FLAGS_gpuFrameLag;
48 return true; 41 return true;
49 } 42 }
50 43
51 bool HWUITarget::init(SkImageInfo info, Benchmark* bench) { 44 bool HWUITarget::init(SkImageInfo info, Benchmark* bench) {
52 this->renderer.initialize({bench->getSize().x(), bench->getSize().y()}); 45 this->renderer.initialize(bench->getSize().x(), bench->getSize().y());
53 return true; 46 return true;
54 } 47 }
55 48
56 bool HWUITarget::capturePixels(SkBitmap* bmp) { 49 bool HWUITarget::capturePixels(SkBitmap* bmp) {
57 return this->renderer.capturePixels(bmp); 50 return this->renderer.capturePixels(bmp);
58 } 51 }
59 52
60 53
OLDNEW
« no previous file with comments | « bench/nanobenchAndroid.h ('k') | dm/DMSrcSinkAndroid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698