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

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

Issue 4873002: Benchmark tool for GPU-accelerated video rendering (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/tools/shader_bench/shader_bench.cc ('k') | media/tools/shader_bench/window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/tools/shader_bench/window.h
diff --git a/media/tools/shader_bench/window.h b/media/tools/shader_bench/window.h
new file mode 100644
index 0000000000000000000000000000000000000000..b17786a8ff287db4c69b7fb26a01a6274fd1b029
--- /dev/null
+++ b/media/tools/shader_bench/window.h
@@ -0,0 +1,60 @@
+// 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_SHADER_BENCH_WINDOW_H_
+#define MEDIA_TOOLS_SHADER_BENCH_WINDOW_H_
+
+#include "gfx/native_widget_types.h"
+
+class Painter;
+class Task;
+
+namespace media {
+
+class Window {
+ public:
+ Window(int width, int height);
+
+ // Creates and returns a handle to a native window of the given dimensions.
+ gfx::NativeWindow CreateNativeWindow(int width, int height);
+
+ // Returns the NPAPI plugin window handle of the window.
+ gfx::PluginWindowHandle PluginWindow();
+
+ // Kicks off frame painting with the given limit, painter, and
+ // callback to run when painting task is complete.
+ void Start(int limit, Task* done_task, Painter* painter);
+
+ // Called when window is expected to paint self.
+ void OnPaint();
+
+ // Main loop for window.
+ void MainLoop();
+
+ private:
+ // Task to run when frame painting is completed. Will be deleted after
+ // running.
+ Task* done_task_;
+
+ // Reference to painter Window uses to paint frames.
+ Painter* painter_;
+
+ // Number of frames to paint before closing the window.
+ int limit_;
+
+ // Number of frames currently painted.
+ int count_;
+
+ // True if the window is painting video frames to the screen, false otherwise.
+ bool running_;
+
+ // This window's native handle.
+ gfx::NativeWindow window_handle_;
+
+ DISALLOW_COPY_AND_ASSIGN(Window);
+};
+
+} // namespace media
+
+#endif // MEDIA_TOOLS_SHADER_BENCH_WINDOW_H_
« no previous file with comments | « media/tools/shader_bench/shader_bench.cc ('k') | media/tools/shader_bench/window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698