Chromium Code Reviews

Unified Diff: webkit/renderer/compositor_bindings/web_content_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: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: webkit/renderer/compositor_bindings/web_content_layer_impl.cc
diff --git a/webkit/renderer/compositor_bindings/web_content_layer_impl.cc b/webkit/renderer/compositor_bindings/web_content_layer_impl.cc
index 381501a4a1b49735651a83444b0ea14c255a9bb9..752516d68530aaf80568da126d50df67f5fcbdda 100644
--- a/webkit/renderer/compositor_bindings/web_content_layer_impl.cc
+++ b/webkit/renderer/compositor_bindings/web_content_layer_impl.cc
@@ -4,8 +4,6 @@
#include "webkit/renderer/compositor_bindings/web_content_layer_impl.h"
-#include "base/command_line.h"
-#include "cc/base/switches.h"
#include "cc/layers/content_layer.h"
#include "cc/layers/picture_layer.h"
#include "third_party/WebKit/public/platform/WebContentLayerClient.h"
@@ -20,14 +18,10 @@ using cc::PictureLayer;
namespace webkit {
-static bool usingPictureLayer() {
- return cc::switches::IsImplSidePaintingEnabled();
-}
-
WebContentLayerImpl::WebContentLayerImpl(blink::WebContentLayerClient* client)
: client_(client),
ignore_lcd_text_change_(false) {
- if (usingPictureLayer())
+ if (WebLayerImpl::usingPictureLayer())
layer_ = make_scoped_ptr(new WebLayerImpl(PictureLayer::Create(this)));
else
layer_ = make_scoped_ptr(new WebLayerImpl(ContentLayer::Create(this)));
@@ -36,7 +30,7 @@ WebContentLayerImpl::WebContentLayerImpl(blink::WebContentLayerClient* client)
}
WebContentLayerImpl::~WebContentLayerImpl() {
- if (usingPictureLayer())
+ if (WebLayerImpl::usingPictureLayer())
static_cast<PictureLayer*>(layer_->layer())->ClearClient();
else
static_cast<ContentLayer*>(layer_->layer())->ClearClient();
@@ -61,7 +55,7 @@ void WebContentLayerImpl::PaintContents(SkCanvas* canvas,
blink::WebFloatRect web_opaque;
// For picture layers, always record with LCD text. PictureLayerImpl
// will turn this off later during rasterization.
- bool use_lcd_text = usingPictureLayer() || can_use_lcd_text_;
+ bool use_lcd_text = WebLayerImpl::usingPictureLayer() || can_use_lcd_text_;
client_->paintContents(canvas, clip, use_lcd_text, web_opaque);
*opaque = web_opaque;
}

Powered by Google App Engine