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

Unified Diff: content/browser/android/content_view_render_view.cc

Issue 201583004: Add layerTreeBuildHelper to control layer tree in ContentViewRenderView (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: GetLayerTree returns a scoped pointer Created 6 years, 8 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 | « content/browser/android/content_view_render_view.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/content_view_render_view.cc
diff --git a/content/browser/android/content_view_render_view.cc b/content/browser/android/content_view_render_view.cc
index db42223b18ae88eeb2374d18bcb9818cfb76be2b..fc6a54cbe034caeac6b6f5b62184edda3413fb1b 100644
--- a/content/browser/android/content_view_render_view.cc
+++ b/content/browser/android/content_view_render_view.cc
@@ -15,6 +15,7 @@
#include "content/browser/android/content_view_core_impl.h"
#include "content/public/browser/android/compositor.h"
#include "content/public/browser/android/content_view_layer_renderer.h"
+#include "content/public/browser/android/layer_tree_build_helper.h"
Yaron 2014/04/23 18:54:43 i think you forgot to "git add" these :)
Yusuf 2014/04/23 20:00:03 Oops. Sorry about that. On 2014/04/23 18:54:43, Y
#include "jni/ContentViewRenderView_jni.h"
#include "ui/gfx/android/java_bitmap.h"
#include "ui/gfx/size.h"
@@ -35,16 +36,30 @@ ContentViewRenderView::ContentViewRenderView(JNIEnv* env,
jobject obj,
gfx::NativeWindow root_window)
: buffers_swapped_during_composite_(false),
+ root_layer_(cc::Layer::Create()),
+ layer_tree_build_helper_(new LayerTreeBuildHelper()),
root_window_(root_window),
current_surface_format_(0) {
+ root_layer_->SetIsDrawable(true);
java_obj_.Reset(env, obj);
}
ContentViewRenderView::~ContentViewRenderView() {
}
+void ContentViewRenderView::SetLayerTreeBuildHelper(JNIEnv* env,
+ jobject obj,
+ jlong native_build_helper) {
+ CHECK(native_build_helper);
+
+ LayerTreeBuildHelper* build_helper =
+ reinterpret_cast<LayerTreeBuildHelper*>(native_build_helper);
+ layer_tree_build_helper_ = build_helper;
+}
// static
-static jlong Init(JNIEnv* env, jobject obj, jlong native_root_window) {
+static jlong Init(JNIEnv* env,
+ jobject obj,
+ jlong native_root_window) {
gfx::NativeWindow root_window =
reinterpret_cast<gfx::NativeWindow>(native_root_window);
ContentViewRenderView* content_view_render_view =
@@ -61,10 +76,8 @@ void ContentViewRenderView::SetCurrentContentView(
InitCompositor();
ContentViewCoreImpl* content_view =
reinterpret_cast<ContentViewCoreImpl*>(native_content_view);
- if (content_view)
- compositor_->SetRootLayer(content_view->GetLayer());
- else
- compositor_->SetRootLayer(cc::Layer::Create());
+ root_layer_ = layer_tree_build_helper_->GetLayerTree(content_view);
Yaron 2014/04/23 18:54:43 I thought I suggested to pass they layer in right
Yusuf 2014/04/23 20:00:03 Done.
+ compositor_->SetRootLayer(root_layer_);
}
void ContentViewRenderView::SurfaceCreated(
@@ -128,5 +141,4 @@ void ContentViewRenderView::InitCompositor() {
if (!compositor_)
compositor_.reset(Compositor::Create(this, root_window_));
}
-
} // namespace content
« no previous file with comments | « content/browser/android/content_view_render_view.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698