summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortrchen@chromium.org <trchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-26 09:19:10 +0000
committertrchen@chromium.org <trchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-26 09:19:10 +0000
commit59ea91d17ed9edf04e59f00d02ef2d62c3ca55fe (patch)
tree0a9d538673c25be68420beb7428934f868a7a914
parent2da32e7e721929041e822ed094220860588e0bf9 (diff)
downloadchromium_src-59ea91d17ed9edf04e59f00d02ef2d62c3ca55fe.zip
chromium_src-59ea91d17ed9edf04e59f00d02ef2d62c3ca55fe.tar.gz
chromium_src-59ea91d17ed9edf04e59f00d02ef2d62c3ca55fe.tar.bz2
Convert USE(NATIVE_FULLSCREEN_VIDEO) to a runtime enabled feature
This patch adds the boilerplate code to propagate command line switch to Blink, and selectively enables alpha channel in content_shell for layout tests. Blink patch: https://codereview.chromium.org/22454003 R=jam@chromium.org Review URL: https://codereview.chromium.org/23597036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225412 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/browser/android/content_startup_flags.cc3
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc1
-rw-r--r--content/child/runtime_features.cc3
-rw-r--r--content/public/common/content_switches.cc3
-rw-r--r--content/public/common/content_switches.h1
-rw-r--r--content/shell/browser/webkit_test_controller.cc3
-rw-r--r--content/shell/renderer/webkit_test_runner.cc6
7 files changed, 18 insertions, 2 deletions
diff --git a/content/browser/android/content_startup_flags.cc b/content/browser/android/content_startup_flags.cc
index 1bac2ef..b755e4d 100644
--- a/content/browser/android/content_startup_flags.cc
+++ b/content/browser/android/content_startup_flags.cc
@@ -62,8 +62,9 @@ void SetContentCommandLineFlags(int max_render_process_count,
parsed_command_line->AppendSwitch(switches::kEnableGestureTapHighlight);
parsed_command_line->AppendSwitch(switches::kEnablePinch);
- parsed_command_line->AppendSwitch(switches::kEnableOverscrollNotifications);
+ parsed_command_line->AppendSwitch(switches::kEnableOverlayFullscreenVideo);
parsed_command_line->AppendSwitch(switches::kEnableOverlayScrollbars);
+ parsed_command_line->AppendSwitch(switches::kEnableOverscrollNotifications);
// Run the GPU service as a thread in the browser instead of as a
// standalone process.
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index aac1dcc..23d498c 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -932,6 +932,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
#endif
switches::kEnableMP3StreamParser,
switches::kEnableMemoryBenchmarking,
+ switches::kEnableOverlayFullscreenVideo,
switches::kEnableOverlayScrollbars,
switches::kEnableSkiaBenchmarking,
switches::kEnableLogging,
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
index 7f610f1..8e57d9c 100644
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -132,6 +132,9 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
if (command_line.HasSwitch(switches::kEnableHTMLImports))
WebRuntimeFeatures::enableHTMLImports(true);
+ if (command_line.HasSwitch(switches::kEnableOverlayFullscreenVideo))
+ WebRuntimeFeatures::enableOverlayFullscreenVideo(true);
+
if (command_line.HasSwitch(switches::kEnableOverlayScrollbars))
WebRuntimeFeatures::enableOverlayScrollbars(true);
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
index 9eba523..6c7cea8 100644
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -448,6 +448,9 @@ const char kEnableMonitorProfile[] = "enable-monitor-profile";
// Enables use of cache if offline, even if it's stale
const char kEnableOfflineCacheAccess[] = "enable-offline-cache-access";
+// Enables use of hardware overlay for fullscreen video playback. Android only.
+const char kEnableOverlayFullscreenVideo[] = "enable-overlay-fullscreen-video";
+
// Enables overlay scrollbars on Aura or Linux. Does nothing on Mac.
const char kEnableOverlayScrollbars[] = "enable-overlay-scrollbars";
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
index 8be2d28..d60a350 100644
--- a/content/public/common/content_switches.h
+++ b/content/public/common/content_switches.h
@@ -138,6 +138,7 @@ CONTENT_EXPORT extern const char kEnableLogging[];
extern const char kEnableMemoryBenchmarking[];
extern const char kEnableMonitorProfile[];
CONTENT_EXPORT extern const char kEnableOfflineCacheAccess[];
+CONTENT_EXPORT extern const char kEnableOverlayFullscreenVideo[];
extern const char kEnableOverlayScrollbars[];
CONTENT_EXPORT extern const char kEnableOverscrollNotifications[];
extern const char kEnablePinch[];
diff --git a/content/shell/browser/webkit_test_controller.cc b/content/shell/browser/webkit_test_controller.cc
index 52f0611..6c2a603 100644
--- a/content/shell/browser/webkit_test_controller.cc
+++ b/content/shell/browser/webkit_test_controller.cc
@@ -517,6 +517,9 @@ void WebKitTestController::OnImageDump(
#else
bool discard_transparency = true;
#endif
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableOverlayFullscreenVideo))
+ discard_transparency = false;
std::vector<gfx::PNGCodec::Comment> comments;
comments.push_back(gfx::PNGCodec::Comment("checksum", actual_pixel_hash));
diff --git a/content/shell/renderer/webkit_test_runner.cc b/content/shell/renderer/webkit_test_runner.cc
index d93a967..69f32cc 100644
--- a/content/shell/renderer/webkit_test_runner.cc
+++ b/content/shell/renderer/webkit_test_runner.cc
@@ -9,6 +9,7 @@
#include <cmath>
#include "base/base64.h"
+#include "base/command_line.h"
#include "base/debug/debugger.h"
#include "base/files/file_path.h"
#include "base/md5.h"
@@ -19,6 +20,7 @@
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
+#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
#include "content/public/renderer/history_item_serialization.h"
#include "content/public/renderer/render_view.h"
@@ -117,7 +119,9 @@ void CopyCanvasToBitmap(SkCanvas* canvas, SkBitmap* snapshot) {
#if !defined(OS_MACOSX)
// Only the expected PNGs for Mac have a valid alpha channel.
- MakeBitmapOpaque(snapshot);
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableOverlayFullscreenVideo))
+ MakeBitmapOpaque(snapshot);
#endif
}