Index: src/utils/android/SkHwuiRenderer.h |
diff --git a/bench/nanobenchAndroid.h b/src/utils/android/SkHwuiRenderer.h |
similarity index 56% |
copy from bench/nanobenchAndroid.h |
copy to src/utils/android/SkHwuiRenderer.h |
index 3baeb1270fb5794a6e6a87e9fb1c7a8b806377d5..2e1ce4ebe83d4762712153fae192688afbccb3fb 100644 |
--- a/bench/nanobenchAndroid.h |
+++ b/src/utils/android/SkHwuiRenderer.h |
@@ -5,24 +5,21 @@ |
* found in the LICENSE file. |
*/ |
-#ifndef nanobenchAndroid_DEFINED |
-#define nanobenchAndroid_DEFINED |
+#ifndef SkHwuiRenderer_DEFINED |
+#define SkHwuiRenderer_DEFINED |
#include "DisplayListRenderer.h" |
#include "RenderNode.h" |
-#include "SkAndroidSDKCanvas.h" |
-#include "gui/BufferQueue.h" |
+#include "SkTypes.h" |
#include "gui/CpuConsumer.h" |
#include "gui/IGraphicBufferConsumer.h" |
#include "gui/IGraphicBufferProducer.h" |
#include "gui/Surface.h" |
#include "renderthread/RenderProxy.h" |
-#include "nanobench.h" |
- |
-struct HWUITarget : public Target { |
- explicit HWUITarget(const Config& c, Benchmark* bench); |
+class SkBitmap; |
+struct SkHwuiRenderer { |
SkAutoTDelete<android::uirenderer::RenderNode> rootNode; |
SkAutoTDelete<android::uirenderer::renderthread::RenderProxy> proxy; |
SkAutoTDelete<android::uirenderer::DisplayListRenderer> renderer; |
@@ -31,19 +28,15 @@ struct HWUITarget : public Target { |
android::sp<android::CpuConsumer> cpuConsumer; |
android::sp<android::Surface> androidSurface; |
SkISize size; |
- SkAndroidSDKCanvas fc; |
- void setup() override; |
- SkCanvas* beginTiming(SkCanvas* canvas) override; |
- void endTiming() override; |
- void fence() override; |
- bool needsFrameTiming() const override; |
+ void initialize(SkISize size); |
- /// Returns false if initialization fails |
- bool init(SkImageInfo info, Benchmark* bench) override; |
- bool capturePixels(SkBitmap* bmp) override; |
-}; |
+ /// Returns a canvas to draw into. |
+ SkCanvas* prepareToDraw(); |
+ void finishDrawing(); |
+ bool capturePixels(SkBitmap* bmp); |
+}; |
-#endif // nanobenchAndroid_DEFINED |
+#endif // SkHwuiRenderer_DEFINED |