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

Unified Diff: webkit/renderer/compositor_bindings/web_layer_impl.cc

Issue 122063002: cc: Remove racy initialization code in cc/base/switches.cc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix dynamic linking problem by adding dynamic_annotations dependency to compositor_bindings Created 6 years, 11 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
« no previous file with comments | « webkit/renderer/compositor_bindings/web_layer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/renderer/compositor_bindings/web_layer_impl.cc
diff --git a/webkit/renderer/compositor_bindings/web_layer_impl.cc b/webkit/renderer/compositor_bindings/web_layer_impl.cc
index 22a5485a3cf3cac935a02b2d67055175e568711f..17fa373804df0bb2804cdb8117a0593539ae0480 100644
--- a/webkit/renderer/compositor_bindings/web_layer_impl.cc
+++ b/webkit/renderer/compositor_bindings/web_layer_impl.cc
@@ -6,10 +6,12 @@
#include "base/bind.h"
#include "base/debug/trace_event_impl.h"
+#include "base/lazy_instance.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_checker.h"
#include "cc/animation/animation.h"
#include "cc/base/region.h"
+#include "cc/base/switches.h"
#include "cc/layers/layer.h"
#include "cc/layers/layer_position_constraint.h"
#include "third_party/WebKit/public/platform/WebCompositingReasons.h"
@@ -37,6 +39,18 @@ using blink::WebColor;
using blink::WebFilterOperations;
namespace webkit {
+namespace {
+
+struct ImplSidePaintingStatus {
+ ImplSidePaintingStatus()
+ : enabled(cc::switches::IsImplSidePaintingEnabled()) {
+ }
+ bool enabled;
+};
+base::LazyInstance<ImplSidePaintingStatus> g_impl_side_painting_status =
+ LAZY_INSTANCE_INITIALIZER;
+
+} // namespace
WebLayerImpl::WebLayerImpl() : layer_(Layer::Create()) {
web_layer_client_ = NULL;
@@ -54,6 +68,11 @@ WebLayerImpl::~WebLayerImpl() {
web_layer_client_ = NULL;
}
+// static
+bool WebLayerImpl::UsingPictureLayer() {
+ return g_impl_side_painting_status.Get().enabled;
+}
+
int WebLayerImpl::id() const { return layer_->id(); }
void WebLayerImpl::invalidateRect(const blink::WebFloatRect& rect) {
« no previous file with comments | « webkit/renderer/compositor_bindings/web_layer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698