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

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: 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
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..a7a97134ead350b91a28f138345618693148f5e0 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
This is Rietveld 408576698