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

Unified Diff: content/common/gpu/media/rendering_helper.h

Issue 294663006: vda_unittest - Move the fps control from ThrottleVDAClient to RenderingHelper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/media/rendering_helper.h
diff --git a/content/common/gpu/media/rendering_helper.h b/content/common/gpu/media/rendering_helper.h
index 3ba1fc30d14725317108ee5ded9c2890e3b3ddc3..97306599b009b9e43511da26372243705138da08 100644
--- a/content/common/gpu/media/rendering_helper.h
+++ b/content/common/gpu/media/rendering_helper.h
@@ -33,8 +33,7 @@ namespace content {
struct RenderingHelperParams {
RenderingHelperParams();
~RenderingHelperParams();
-
- bool suppress_swap_to_display;
+ int rendering_fps;
int num_windows;
// Dimensions of window(s) created for displaying frames. In the
// case of thumbnail rendering, these won't match the frame dimensions.
@@ -50,6 +49,14 @@ struct RenderingHelperParams {
gfx::Size thumbnail_size;
};
+class RenderingHelper;
+
+class RenderingClient {
Ami GONE FROM CHROMIUM 2014/05/21 18:25:54 what is this? (please document all classes, _espec
Owen Lin 2014/05/26 06:21:07 Done.
+ public:
+ virtual void RenderContent(RenderingHelper* helper) = 0;
Ami GONE FROM CHROMIUM 2014/05/21 18:25:54 Prefer callbacks to interface types like this. E.
Owen Lin 2014/05/26 06:21:07 Moved into RenderingHelper. I am going to add some
+ protected:
+ virtual ~RenderingClient() {}
+};
// Creates and draws textures used by the video decoder.
Ami GONE FROM CHROMIUM 2014/05/21 18:25:54 "draws" is now a lie? Comment needs updating.
Owen Lin 2014/05/26 06:21:07 This class is the one who really draws textures.
// This class is not thread safe and thus all the methods of this class
@@ -66,6 +73,8 @@ class RenderingHelper {
// Undo the effects of Initialize() and signal |*done|.
void UnInitialize(base::WaitableEvent* done);
+ void SetClient(int window_id, RenderingClient* client);
Ami GONE FROM CHROMIUM 2014/05/21 18:25:54 Would be easier to grok as a param to a once-only
Owen Lin 2014/05/26 06:21:07 Passed as the parameter of Initialize().
+
// Return a newly-created GLES2 texture id rendering to a specific window, and
// signal |*done|.
void CreateTexture(int window_id,
@@ -73,7 +82,12 @@ class RenderingHelper {
uint32* texture_id,
base::WaitableEvent* done);
- // Render |texture_id| to the screen using target |texture_target|.
+ // Render thumbnail in the |texture_id| to the FBO buffer using target
+ // |texture_target|.
+ void RenderThumbnail(uint32 texture_target, uint32 texture_id);
+
+ // Render |texture_id| to the current view port of the screen using target
+ // |texture_target|.
void RenderTexture(uint32 texture_target, uint32 texture_id);
// Delete |texture_id|.
@@ -95,10 +109,6 @@ class RenderingHelper {
void Clear();
void RenderContent();
- void DrawTexture(const gfx::Rect &area,
- uint32 texture_target,
- uint32 texture_id);
-
base::RepeatingTimer<RenderingHelper> render_timer_;
base::MessageLoop* message_loop_;
std::vector<gfx::Size> frame_dimensions_;
@@ -123,9 +133,7 @@ class RenderingHelper {
// The rendering area of each window on the screen.
std::vector<gfx::Rect> render_areas_;
- // The texture to be rendered on each window.
- std::vector<uint32> texture_ids_;
- std::vector<uint32> texture_targets_;
+ std::vector<RenderingClient*> clients_;
bool render_as_thumbnails_;
int frame_count_;

Powered by Google App Engine
This is Rietveld 408576698