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

Side by Side Diff: content/common/gpu/media/rendering_helper.cc

Issue 936703002: Fix UiThreadGpu initialization for video accelerator tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/common/gpu/media/video_decode_accelerator_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/gpu/media/rendering_helper.h" 5 #include "content/common/gpu/media/rendering_helper.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <numeric> 8 #include <numeric>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 24 matching lines...) Expand all
35 #else 35 #else
36 #include "ui/gl/gl_surface_egl.h" 36 #include "ui/gl/gl_surface_egl.h"
37 #define GL_VARIANT_EGL 1 37 #define GL_VARIANT_EGL 1
38 #endif 38 #endif
39 39
40 #if defined(USE_OZONE) 40 #if defined(USE_OZONE)
41 #if defined(OS_CHROMEOS) 41 #if defined(OS_CHROMEOS)
42 #include "ui/display/chromeos/display_configurator.h" 42 #include "ui/display/chromeos/display_configurator.h"
43 #endif // defined(OS_CHROMEOS) 43 #endif // defined(OS_CHROMEOS)
44 #include "ui/ozone/public/ozone_platform.h" 44 #include "ui/ozone/public/ozone_platform.h"
45 #include "ui/ozone/public/ui_thread_gpu.h"
46 #include "ui/platform_window/platform_window.h" 45 #include "ui/platform_window/platform_window.h"
47 #include "ui/platform_window/platform_window_delegate.h" 46 #include "ui/platform_window/platform_window_delegate.h"
48 #endif // defined(USE_OZONE) 47 #endif // defined(USE_OZONE)
49 48
50 // Helper for Shader creation. 49 // Helper for Shader creation.
51 static void CreateShader(GLuint program, 50 static void CreateShader(GLuint program,
52 GLenum type, 51 GLenum type,
53 const char* source, 52 const char* source,
54 int size) { 53 int size) {
55 GLuint shader = glCreateShader(type); 54 GLuint shader = glCreateShader(type);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 90 }
92 91
93 base::RunLoop* loop_; 92 base::RunLoop* loop_;
94 93
95 DISALLOW_COPY_AND_ASSIGN(DisplayConfiguratorObserver); 94 DISALLOW_COPY_AND_ASSIGN(DisplayConfiguratorObserver);
96 }; 95 };
97 96
98 class RenderingHelper::StubOzoneDelegate : public ui::PlatformWindowDelegate { 97 class RenderingHelper::StubOzoneDelegate : public ui::PlatformWindowDelegate {
99 public: 98 public:
100 StubOzoneDelegate() : accelerated_widget_(gfx::kNullAcceleratedWidget) { 99 StubOzoneDelegate() : accelerated_widget_(gfx::kNullAcceleratedWidget) {
101 ui_thread_gpu_.Initialize();
102 platform_window_ = ui::OzonePlatform::GetInstance()->CreatePlatformWindow( 100 platform_window_ = ui::OzonePlatform::GetInstance()->CreatePlatformWindow(
103 this, gfx::Rect()); 101 this, gfx::Rect());
104 } 102 }
105 ~StubOzoneDelegate() override {} 103 ~StubOzoneDelegate() override {}
106 104
107 void OnBoundsChanged(const gfx::Rect& new_bounds) override {} 105 void OnBoundsChanged(const gfx::Rect& new_bounds) override {}
108 106
109 void OnDamageRect(const gfx::Rect& damaged_region) override {} 107 void OnDamageRect(const gfx::Rect& damaged_region) override {}
110 108
111 void DispatchEvent(ui::Event* event) override {} 109 void DispatchEvent(ui::Event* event) override {}
(...skipping 13 matching lines...) Expand all
125 123
126 gfx::AcceleratedWidget accelerated_widget() const { 124 gfx::AcceleratedWidget accelerated_widget() const {
127 return accelerated_widget_; 125 return accelerated_widget_;
128 } 126 }
129 127
130 gfx::Size GetSize() { return platform_window_->GetBounds().size(); } 128 gfx::Size GetSize() { return platform_window_->GetBounds().size(); }
131 129
132 ui::PlatformWindow* platform_window() const { return platform_window_.get(); } 130 ui::PlatformWindow* platform_window() const { return platform_window_.get(); }
133 131
134 private: 132 private:
135 ui::UiThreadGpu ui_thread_gpu_;
136 scoped_ptr<ui::PlatformWindow> platform_window_; 133 scoped_ptr<ui::PlatformWindow> platform_window_;
137 gfx::AcceleratedWidget accelerated_widget_; 134 gfx::AcceleratedWidget accelerated_widget_;
138 135
139 DISALLOW_COPY_AND_ASSIGN(StubOzoneDelegate); 136 DISALLOW_COPY_AND_ASSIGN(StubOzoneDelegate);
140 }; 137 };
141 138
142 #endif // defined(USE_OZONE) 139 #endif // defined(USE_OZONE)
143 140
144 RenderingHelperParams::RenderingHelperParams() 141 RenderingHelperParams::RenderingHelperParams()
145 : rendering_fps(0), warm_up_iterations(0), render_as_thumbnails(false) { 142 : rendering_fps(0), warm_up_iterations(0), render_as_thumbnails(false) {
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 // When the rendering falls behind, drops frames. 830 // When the rendering falls behind, drops frames.
834 while (scheduled_render_time_ < target) { 831 while (scheduled_render_time_ < target) {
835 scheduled_render_time_ += frame_duration_; 832 scheduled_render_time_ += frame_duration_;
836 DropOneFrameForAllVideos(); 833 DropOneFrameForAllVideos();
837 } 834 }
838 835
839 message_loop_->PostDelayedTask( 836 message_loop_->PostDelayedTask(
840 FROM_HERE, render_task_.callback(), target - now); 837 FROM_HERE, render_task_.callback(), target - now);
841 } 838 }
842 } // namespace content 839 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/media/video_decode_accelerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698