Chromium Code Reviews

Unified Diff: media/tools/shader_bench/painter.h

Issue 4873002: Benchmark tool for GPU-accelerated video rendering (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added more shaders, used message loop, and cleaned up code Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: media/tools/shader_bench/painter.h
diff --git a/media/tools/shader_bench/painter.h b/media/tools/shader_bench/painter.h
new file mode 100644
index 0000000000000000000000000000000000000000..856f044697df65062d695d7ea188019ecd0b17b7
--- /dev/null
+++ b/media/tools/shader_bench/painter.h
@@ -0,0 +1,35 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_TOOLS_BENCHMARK_PAINTER_H_
+#define MEDIA_TOOLS_BENCHMARK_PAINTER_H_
+
+#include <deque>
+
+#include "base/scoped_ptr.h"
+#include "media/base/video_frame.h"
+
+// Class that paints video frames to a window.
+class Painter {
+ public:
+ Painter();
+
+ // Initialize a Painter class with a width and a height
+ virtual void Initialize(int width, int height) = 0;
+
+ // Loads frames into Painter. Painter does not take ownership of frames.
+ virtual void LoadFrames(
+ std::deque<scoped_refptr<media::VideoFrame> >* frames);
+
+ // Called window is ready to be painted.
+ virtual void OnPaint();
+
+ // Paint a single frame to a window.
+ virtual void Paint(scoped_refptr<media::VideoFrame> video_frame) = 0;
+
+ protected:
+ std::deque<scoped_refptr<media::VideoFrame> >* frames_;
+};
+
+#endif // MEDIA_TOOLS_BENCHMARK_PAINTER_H_

Powered by Google App Engine