Skip to content

Commit

Permalink
Revert of p1 mus+ash chrome renders ui and content (patchset chromium#9
Browse files Browse the repository at this point in the history
… id:160001 of https://codereview.chromium.org/1438903002/ )

Reason for revert:
Broken compilation: https://build.chromium.org/p/chromium.chrome/builders/Google%20Chrome%20Linux%20x64/builds/5923

Original issue's description:
> p1 mus+ash chrome renders ui and content
>
> This patch forces mus+ash Chrome to software composite the ui and content
> region into a single bitmap that is uploaded to the mus window server. The
> approach here is similar to how Chrome paints to X11 when hardware acceleration
> is not available.
>
> BUG=554699
> CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
>
> Committed: https://crrev.com/e482a6010424204e7c8e313c5922acc38506be5c
> Cr-Commit-Position: refs/heads/master@{#360289}

TBR=sky@chromium.org,jam@chromium.org,fsamuel@chromium.org,ben@chromium.org,ccameron@chromium.org,rjkroege@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=554699,557595

Review URL: https://codereview.chromium.org/1460593004

Cr-Commit-Position: refs/heads/master@{#360314}
  • Loading branch information
msramek authored and Commit bot committed Nov 18, 2015
1 parent cb4ed16 commit 215dc61
Show file tree
Hide file tree
Showing 15 changed files with 6 additions and 177 deletions.
6 changes: 1 addition & 5 deletions base/threading/thread_restrictions.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class GpuChannelHost;
class NestedMessagePumpAndroid;
class ScopedAllowWaitForAndroidLayoutTests;
class ScopedAllowWaitForDebugURL;
class SoftwareOutputDeviceMus;
class TextInputClientMac;
} // namespace content
namespace dbus {
Expand Down Expand Up @@ -218,10 +217,7 @@ class BASE_EXPORT ThreadRestrictions {
friend class net::NetworkChangeNotifierMac; // http://crbug.com/125097
friend class ::BrowserProcessImpl; // http://crbug.com/125207
friend class ::NativeBackendKWallet; // http://crbug.com/125331
#if !defined(OFFICIAL_BUILD)
friend class content::SoftwareOutputDeviceMus; // Interim non-production code
#endif
// END USAGE THAT NEEDS TO BE FIXED.
// END USAGE THAT NEEDS TO BE FIXED.

#if ENABLE_THREAD_RESTRICTIONS
static bool SetWaitAllowed(bool allowed);
Expand Down
4 changes: 0 additions & 4 deletions chrome/browser/ui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,6 @@ source_set("ui") {
}
}

if (use_aura) {
defines += [ "MOJO_RUNNER_CLIENT" ]
}

if (enable_basic_printing || enable_print_preview) {
deps += [ "//printing" ]
}
Expand Down
3 changes: 0 additions & 3 deletions components/bitmap_uploader/bitmap_uploader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ void OnGotContentHandlerID(uint32_t content_handler_id) {}

} // namespace

const char kBitmapUploaderForAcceleratedWidget[] =
"__BITMAP_UPLOADER_ACCELERATED_WIDGET__";

BitmapUploader::BitmapUploader(mus::Window* window)
: window_(window),
color_(g_transparent_color),
Expand Down
2 changes: 0 additions & 2 deletions components/bitmap_uploader/bitmap_uploader.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ class Shell;

namespace bitmap_uploader {

extern const char kBitmapUploaderForAcceleratedWidget[];

// BitmapUploader is useful if you want to draw a bitmap or color in a
// mus::Window.
class BitmapUploader : public mus::mojom::SurfaceClient {
Expand Down
6 changes: 0 additions & 6 deletions content/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -427,13 +427,7 @@ source_set("browser") {
"//ui/strings",
"//ui/views/mus:for_component",
"//ui/wm",
"//components/bitmap_uploader",
]
sources += [
"compositor/software_output_device_mus.cc",
"compositor/software_output_device_mus.h",
]
defines += [ "MOJO_RUNNER_CLIENT" ]
} else { # Not aura.
sources -= [
"media/capture/cursor_renderer_aura.cc",
Expand Down
3 changes: 1 addition & 2 deletions content/browser/compositor/DEPS
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include_rules = [
"+components/bitmap_uploader",
"+ui/platform_window",
"+ui/platform_window",
]
19 changes: 0 additions & 19 deletions content/browser/compositor/gpu_process_transport_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "content/browser/compositor/offscreen_browser_compositor_output_surface.h"
#include "content/browser/compositor/reflector_impl.h"
#include "content/browser/compositor/software_browser_compositor_output_surface.h"
#include "content/browser/compositor/software_output_device_mus.h"
#include "content/browser/gpu/browser_gpu_channel_host_factory.h"
#include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
#include "content/browser/gpu/compositor_util.h"
Expand Down Expand Up @@ -149,14 +148,6 @@ GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() {
scoped_ptr<cc::SoftwareOutputDevice>
GpuProcessTransportFactory::CreateSoftwareOutputDevice(
ui::Compositor* compositor) {
#if defined(MOJO_RUNNER_CLIENT)
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
"mojo-platform-channel-handle")) {
return scoped_ptr<cc::SoftwareOutputDevice>(
new SoftwareOutputDeviceMus(compositor));
}
#endif

#if defined(OS_WIN)
return scoped_ptr<cc::SoftwareOutputDevice>(
new SoftwareOutputDeviceWin(software_backing_.get(), compositor));
Expand Down Expand Up @@ -201,16 +192,6 @@ CreateOverlayCandidateValidator(gfx::AcceleratedWidget widget) {
}

static bool ShouldCreateGpuOutputSurface(ui::Compositor* compositor) {
#if defined(MOJO_RUNNER_CLIENT)
// Chrome running as a mojo app currently can only use software compositing.
// TODO(rjkroege): http://crbug.com/548451
// TODO(rjkroege): Make IsRunningInMojoRunner callable from content.
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
"mojo-platform-channel-handle")) {
return false;
}
#endif

#if defined(OS_CHROMEOS)
// Software fallback does not happen on Chrome OS.
return true;
Expand Down
59 changes: 0 additions & 59 deletions content/browser/compositor/software_output_device_mus.cc

This file was deleted.

36 changes: 0 additions & 36 deletions content/browser/compositor/software_output_device_mus.h

This file was deleted.

1 change: 0 additions & 1 deletion ui/views/mus/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ component("mus") {
"//base/third_party/dynamic_annotations",
"//cc",
"//cc/surfaces",
"//components/bitmap_uploader",
"//components/mus/gles2:lib",
"//components/mus/public/cpp",
"//components/mus/public/interfaces",
Expand Down
1 change: 0 additions & 1 deletion ui/views/mus/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ include_rules = [
"+cc",
"-cc/blink",
"+components/font_service/public",
"+components/bitmap_uploader",
"+components/gpu",
"+components/mus",
"+components/resource_provider",
Expand Down
8 changes: 3 additions & 5 deletions ui/views/mus/native_widget_mus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,13 @@ void NativeWidgetMus::InitNativeWidget(const Widget::InitParams& params) {
// picked up.
ui::ContextFactory* default_context_factory =
aura::Env::GetInstance()->context_factory();
// For Chrome, we need the GpuProcessTransportFactory so that renderer and
// browser pixels are composited into a single backing
// SoftwareOutputDeviceMus.
if (!default_context_factory)
aura::Env::GetInstance()->set_context_factory(context_factory_.get());
aura::Env::GetInstance()->set_context_factory(context_factory_.get());
window_tree_host_.reset(
new WindowTreeHostMus(shell_, this, window_, surface_type_));
window_tree_host_->InitHost();
aura::Env::GetInstance()->set_context_factory(default_context_factory);
DCHECK_EQ(context_factory_.get(),
window_tree_host_->compositor()->context_factory());

focus_client_.reset(new wm::FocusController(new FocusRulesImpl));

Expand Down
16 changes: 1 addition & 15 deletions ui/views/mus/platform_window_mus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@

namespace views {

namespace {
static uint32_t accelerated_widget_count = 1;

} // namespace

PlatformWindowMus::PlatformWindowMus(ui::PlatformWindowDelegate* delegate,
mus::Window* mus_window)
: delegate_(delegate),
Expand All @@ -28,18 +23,9 @@ PlatformWindowMus::PlatformWindowMus(ui::PlatformWindowDelegate* delegate,
DCHECK(mus_window_);
mus_window_->AddObserver(this);

// We need accelerated widget numbers to be different for each
// window and fit in the smallest sizeof(AcceleratedWidget) uint32_t
// has this property.
#if defined(OS_WIN)
delegate_->OnAcceleratedWidgetAvailable(
reinterpret_cast<gfx::AcceleratedWidget>(accelerated_widget_count++),
mus_window_->viewport_metrics().device_pixel_ratio);
#else
delegate_->OnAcceleratedWidgetAvailable(
static_cast<gfx::AcceleratedWidget>(accelerated_widget_count++),
gfx::kNullAcceleratedWidget,
mus_window_->viewport_metrics().device_pixel_ratio);
#endif
}

PlatformWindowMus::~PlatformWindowMus() {
Expand Down
9 changes: 0 additions & 9 deletions ui/views/mus/window_tree_host_mus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@

#include "ui/views/mus/window_tree_host_mus.h"

#include "components/bitmap_uploader/bitmap_uploader.h"
#include "mojo/application/public/interfaces/shell.mojom.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/base/view_prop.h"
#include "ui/events/event.h"
#include "ui/views/mus/input_method_mus.h"
#include "ui/views/mus/native_widget_mus.h"
Expand All @@ -33,13 +31,6 @@ WindowTreeHostMus::WindowTreeHostMus(mojo::Shell* shell,
dispatcher()->set_transform_events(false);
compositor()->SetHostHasTransparentBackground(true);

bitmap_uploader_.reset(new bitmap_uploader::BitmapUploader(window));
bitmap_uploader_->Init(shell);
prop_.reset(
new ui::ViewProp(GetAcceleratedWidget(),
bitmap_uploader::kBitmapUploaderForAcceleratedWidget,
bitmap_uploader_.get()));

input_method_.reset(new InputMethodMUS(this, window));
SetSharedInputMethod(input_method_.get());
}
Expand Down
10 changes: 0 additions & 10 deletions ui/views/mus/window_tree_host_mus.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@

class SkBitmap;

namespace bitmap_uploader {
class BitmapUploader;
}

namespace mojo {
class Shell;
}
Expand All @@ -26,7 +22,6 @@ class Window;

namespace ui {
class Compositor;
class ViewProp;
}

namespace views {
Expand All @@ -44,9 +39,6 @@ class VIEWS_MUS_EXPORT WindowTreeHostMus : public aura::WindowTreeHostPlatform {
~WindowTreeHostMus() override;

PlatformWindowMus* platform_window();
bitmap_uploader::BitmapUploader* bitmap_uploader() {
return bitmap_uploader_.get();
};
ui::PlatformWindowState show_state() const { return show_state_; }

private:
Expand All @@ -59,8 +51,6 @@ class VIEWS_MUS_EXPORT WindowTreeHostMus : public aura::WindowTreeHostPlatform {
NativeWidgetMus* native_widget_;
scoped_ptr<InputMethodMUS> input_method_;
ui::PlatformWindowState show_state_;
scoped_ptr<bitmap_uploader::BitmapUploader> bitmap_uploader_;
scoped_ptr<ui::ViewProp> prop_;

DISALLOW_COPY_AND_ASSIGN(WindowTreeHostMus);
};
Expand Down

0 comments on commit 215dc61

Please sign in to comment.