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

Unified Diff: ui/compositor/compositor.cc

Issue 10873073: Remove transitional WEBLAYERTREEVIEW_IS_PURE_VIRTUAL guarded code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 4 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 | « ui/compositor/compositor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/compositor.cc
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index b129ef610ac1d69e9309cf80ea9145b54d28ef88..0aea24187a88b7c398e0cbfac92e249d29ed0750 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -154,14 +154,9 @@ Compositor::Compositor(CompositorDelegate* delegate,
test_compositor_enabled ? kTestRefreshRate : kDefaultRefreshRate;
root_web_layer_->setAnchorPoint(WebKit::WebFloatPoint(0.f, 0.f));
-#if defined(WEBLAYERTREEVIEW_IS_PURE_VIRTUAL)
host_.reset(WebKit::WebLayerTreeView::create(this, *root_web_layer_,
settings));
host_->setSurfaceReady();
-#else
- host_.initialize(this, *root_web_layer_, settings);
- host_.setSurfaceReady();
-#endif
}
Compositor::~Compositor() {
@@ -203,11 +198,7 @@ void Compositor::ScheduleDraw() {
// TODO(nduca): Temporary while compositor calls
// compositeImmediately() directly.
layout();
-#if defined(WEBLAYERTREEVIEW_IS_PURE_VIRTUAL)
host_->composite();
-#else
- host_.composite();
-#endif
} else if (delegate_) {
delegate_->ScheduleDraw();
}
@@ -239,21 +230,13 @@ void Compositor::Draw(bool force_clear) {
// TODO(nduca): Temporary while compositor calls
// compositeImmediately() directly.
layout();
-#if defined(WEBLAYERTREEVIEW_IS_PURE_VIRTUAL)
host_->composite();
-#else
- host_.composite();
-#endif
if (!g_compositor_thread && !swap_posted_)
NotifyEnd();
}
void Compositor::ScheduleFullDraw() {
-#if defined(WEBLAYERTREEVIEW_IS_PURE_VIRTUAL)
host_->setNeedsRedraw();
-#else
- host_.setNeedsRedraw();
-#endif
}
bool Compositor::ReadPixels(SkBitmap* bitmap,
@@ -271,11 +254,7 @@ bool Compositor::ReadPixels(SkBitmap* bitmap,
bitmap->allocPixels();
SkAutoLockPixels lock_image(*bitmap);
unsigned char* pixels = static_cast<unsigned char*>(bitmap->getPixels());
-#if defined(WEBLAYERTREEVIEW_IS_PURE_VIRTUAL)
if (host_->compositeAndReadback(
-#else
- if (host_.compositeAndReadback(
-#endif
pixels, gfx::Rect(new_origin, bounds_in_pixel.size()))) {
SwizzleRGBAToBGRAAndFlip(pixels, bounds_in_pixel.size());
return true;
@@ -288,11 +267,7 @@ void Compositor::SetScaleAndSize(float scale, const gfx::Size& size_in_pixel) {
if (size_in_pixel.IsEmpty() || scale <= 0)
return;
size_ = size_in_pixel;
-#if defined(WEBLAYERTREEVIEW_IS_PURE_VIRTUAL)
host_->setViewportSize(size_in_pixel);
-#else
- host_.setViewportSize(size_in_pixel);
-#endif
root_web_layer_->setBounds(size_in_pixel);
if (device_scale_factor_ != scale) {
« no previous file with comments | « ui/compositor/compositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698