libchromiumcontent/patches/035-use_transparent_window....

49 строки
1.4 KiB
Diff

diff --git a/ui/gl/gpu_switching_manager.cc b/ui/gl/gpu_switching_manager.cc
index 5fdb3cc..16cb3e4 100644
--- a/ui/gl/gpu_switching_manager.cc
+++ b/ui/gl/gpu_switching_manager.cc
@@ -16,6 +16,12 @@
namespace ui {
+namespace {
+
+bool g_use_transparent = false;
+
+} // namespace
+
struct GpuSwitchingManager::PlatformSpecific {
#if defined(OS_MACOSX)
CGLPixelFormatObj discrete_pixel_format;
@@ -27,6 +33,16 @@ GpuSwitchingManager* GpuSwitchingManager::GetInstance() {
return base::Singleton<GpuSwitchingManager>::get();
}
+// static
+void GpuSwitchingManager::SetTransparent(bool transparent) {
+ g_use_transparent = transparent;
+}
+
+// static
+bool GpuSwitchingManager::UseTransparent() {
+ return g_use_transparent;
+}
+
GpuSwitchingManager::GpuSwitchingManager()
: gpu_switching_option_(gl::PreferIntegratedGpu),
gpu_switching_option_set_(false),
diff --git a/ui/gl/gpu_switching_manager.h b/ui/gl/gpu_switching_manager.h
index 4ac7620..e58c879 100644
--- a/ui/gl/gpu_switching_manager.h
+++ b/ui/gl/gpu_switching_manager.h
@@ -25,6 +25,9 @@ class GL_EXPORT GpuSwitchingManager {
// Getter for the singleton. This will return NULL on failure.
static GpuSwitchingManager* GetInstance();
+ static void SetTransparent(bool transparent);
+ static bool UseTransparent();
+
// Set the switching option to PreferIntegratedGpu.
void ForceUseOfIntegratedGpu();
// Set the switching option to PreferDiscreteGpu; switch to discrete GPU