From 11fbf9719c8e418aa7c13ac1317b4d26e61092cc Mon Sep 17 00:00:00 2001 From: Jefry Date: Wed, 1 Oct 2014 13:50:23 +0800 Subject: [PATCH 1/2] [Transparency] [WIN] force refresh/redraw on transparency changes --- Source/core/frame/FrameView.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp index 67281557b3d..e21c6d0ec32 100644 --- a/Source/core/frame/FrameView.cpp +++ b/Source/core/frame/FrameView.cpp @@ -1805,8 +1805,10 @@ void FrameView::setTransparent(bool isTransparent) { m_isTransparent = isTransparent; DisableCompositingQueryAsserts disabler; - if (renderView() && renderView()->layer()->hasCompositedLayerMapping()) + if (renderView() && renderView()->layer()->hasCompositedLayerMapping()) { renderView()->layer()->compositedLayerMapping()->updateContentsOpaque(); + renderView()->layer()->compositedLayerMapping()->setContentsNeedDisplay(); + } } bool FrameView::hasOpaqueBackground() const From d71e5e728e5b76a70d42ebe4d8f196abfb21821a Mon Sep 17 00:00:00 2001 From: Jefry Date: Thu, 20 Nov 2014 13:54:29 +0800 Subject: [PATCH 2/2] [Transparency] add switch to disable the code --- Source/core/frame/FrameView.cpp | 4 +++- public/platform/Platform.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp index e21c6d0ec32..ef32872a6c9 100644 --- a/Source/core/frame/FrameView.cpp +++ b/Source/core/frame/FrameView.cpp @@ -70,6 +70,7 @@ #include "core/rendering/svg/RenderSVGRoot.h" #include "core/svg/SVGDocumentExtensions.h" #include "core/svg/SVGSVGElement.h" +#include "public/platform/Platform.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/ScriptForbiddenScope.h" #include "platform/TraceEvent.h" @@ -1807,7 +1808,8 @@ void FrameView::setTransparent(bool isTransparent) DisableCompositingQueryAsserts disabler; if (renderView() && renderView()->layer()->hasCompositedLayerMapping()) { renderView()->layer()->compositedLayerMapping()->updateContentsOpaque(); - renderView()->layer()->compositedLayerMapping()->setContentsNeedDisplay(); + if (Platform::current()->supportTransparency()) + renderView()->layer()->compositedLayerMapping()->setContentsNeedDisplay(); } } diff --git a/public/platform/Platform.h b/public/platform/Platform.h index c6f9fd88d53..5f6cac39441 100644 --- a/public/platform/Platform.h +++ b/public/platform/Platform.h @@ -637,6 +637,7 @@ class Platform { // node-webkit -------------------------------------------------------- + virtual bool supportTransparency() { return false; } virtual bool supportNodeJS() { return false; } virtual void getCmdArg(int* argc, char*** argv, std::string& snapshot_path) {}