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

Unified Diff: components/html_viewer/html_widget.cc

Issue 1281663002: Mandoline: Allow submitting CompositorFrames directly to mojo::Views (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased + added uip::Surface Created 5 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
Index: components/html_viewer/html_widget.cc
diff --git a/components/html_viewer/html_widget.cc b/components/html_viewer/html_widget.cc
index 17ab20fb4fc7e5915b6d5efcf4854366212743ea..de4032e01bb29c9a518c4a52678ded972a97077c 100644
--- a/components/html_viewer/html_widget.cc
+++ b/components/html_viewer/html_widget.cc
@@ -10,7 +10,6 @@
#include "components/html_viewer/web_layer_tree_view_impl.h"
#include "components/html_viewer/web_storage_namespace_impl.h"
#include "components/view_manager/public/cpp/view.h"
-#include "components/view_manager/public/interfaces/surfaces.mojom.h"
#include "mojo/application/public/cpp/application_impl.h"
#include "third_party/WebKit/public/web/WebFrameWidget.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
@@ -22,22 +21,11 @@ namespace html_viewer {
namespace {
scoped_ptr<WebLayerTreeViewImpl> CreateWebLayerTreeView(
- mojo::ApplicationImpl* app,
GlobalState* global_state) {
- mojo::URLRequestPtr request(mojo::URLRequest::New());
- request->url = mojo::String::From("mojo:view_manager");
- mojo::SurfacePtr surface;
- app->ConnectToService(request.Pass(), &surface);
-
- mojo::URLRequestPtr request2(mojo::URLRequest::New());
- request2->url = mojo::String::From("mojo:view_manager");
- mojo::GpuPtr gpu_service;
- app->ConnectToService(request2.Pass(), &gpu_service);
return make_scoped_ptr(new WebLayerTreeViewImpl(
global_state->compositor_thread(),
global_state->gpu_memory_buffer_manager(),
- global_state->raster_thread_helper()->task_graph_runner(), surface.Pass(),
- gpu_service.Pass()));
+ global_state->raster_thread_helper()->task_graph_runner()));
}
void UpdateWebViewSizeFromViewSize(mojo::View* view,
@@ -94,9 +82,16 @@ HTMLWidgetRootLocal::HTMLWidgetRootLocal(CreateParams* create_params)
// Creating the widget calls initializeLayerTreeView() to create the
// |web_layer_tree_view_impl_|. As we haven't yet assigned the |web_view_|
// we have to set it here.
+ DCHECK(view_);
+ mojo::URLRequestPtr request(mojo::URLRequest::New());
+ request->url = mojo::String::From("mojo:view_manager");
+ mojo::GpuPtr gpu_service;
+ app_->ConnectToService(request.Pass(), &gpu_service);
+
if (web_layer_tree_view_impl_) {
- web_layer_tree_view_impl_->set_widget(web_view_);
- web_layer_tree_view_impl_->set_view(create_params->view);
+ web_layer_tree_view_impl_->Initialize(gpu_service.Pass(),
+ view_,
+ web_view_);
UpdateWebViewSizeFromViewSize(view_, web_view_,
web_layer_tree_view_impl_.get());
}
@@ -119,7 +114,7 @@ void HTMLWidgetRootLocal::didChangeContents() {
}
void HTMLWidgetRootLocal::initializeLayerTreeView() {
- web_layer_tree_view_impl_ = CreateWebLayerTreeView(app_, global_state_);
+ web_layer_tree_view_impl_ = CreateWebLayerTreeView(global_state_);
}
blink::WebLayerTreeView* HTMLWidgetRootLocal::layerTreeView() {
@@ -205,8 +200,14 @@ HTMLWidgetLocalRoot::HTMLWidgetLocalRoot(mojo::ApplicationImpl* app,
// |web_frame_widget_|
// we have to set it here.
if (web_layer_tree_view_impl_) {
- web_layer_tree_view_impl_->set_widget(web_frame_widget_);
- web_layer_tree_view_impl_->set_view(view);
+ DCHECK(view);
sky 2015/08/26 22:58:03 Isn't this and 85-94 about the same? It seems like
Fady Samuel 2015/08/26 23:51:00 Done.
+ mojo::URLRequestPtr request(mojo::URLRequest::New());
+ request->url = mojo::String::From("mojo:view_manager");
+ mojo::GpuPtr gpu_service;
+ app_->ConnectToService(request.Pass(), &gpu_service);
+ web_layer_tree_view_impl_->Initialize(gpu_service.Pass(),
+ view,
+ web_frame_widget_);
UpdateWebViewSizeFromViewSize(view, web_frame_widget_,
web_layer_tree_view_impl_.get());
}
@@ -224,7 +225,7 @@ void HTMLWidgetLocalRoot::OnViewBoundsChanged(mojo::View* view) {
}
void HTMLWidgetLocalRoot::initializeLayerTreeView() {
- web_layer_tree_view_impl_ = CreateWebLayerTreeView(app_, global_state_);
+ web_layer_tree_view_impl_ = CreateWebLayerTreeView(global_state_);
}
blink::WebLayerTreeView* HTMLWidgetLocalRoot::layerTreeView() {

Powered by Google App Engine
This is Rietveld 408576698