OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/android/content_view_render_view.h" | 5 #include "content/browser/android/content_view_render_view.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 compositor_->SetSurface(surface); | 92 compositor_->SetSurface(surface); |
93 } | 93 } |
94 compositor_->SetWindowBounds(gfx::Size(width, height)); | 94 compositor_->SetWindowBounds(gfx::Size(width, height)); |
95 } | 95 } |
96 | 96 |
97 void ContentViewRenderView::SetOverlayVideoMode( | 97 void ContentViewRenderView::SetOverlayVideoMode( |
98 JNIEnv* env, | 98 JNIEnv* env, |
99 const JavaParamRef<jobject>& obj, | 99 const JavaParamRef<jobject>& obj, |
100 bool enabled) { | 100 bool enabled) { |
101 compositor_->SetHasTransparentBackground(enabled); | 101 compositor_->SetHasTransparentBackground(enabled); |
102 SetNeedsComposite(env, obj); | 102 compositor_->SetNeedsComposite(); |
103 } | |
104 | |
105 void ContentViewRenderView::SetNeedsComposite( | |
106 JNIEnv* env, | |
107 const JavaParamRef<jobject>& obj) { | |
108 if (compositor_) | |
109 compositor_->SetNeedsComposite(); | |
110 } | 103 } |
111 | 104 |
112 void ContentViewRenderView::UpdateLayerTreeHost() { | 105 void ContentViewRenderView::UpdateLayerTreeHost() { |
113 // TODO(wkorman): Rename Layout to UpdateLayerTreeHost in all Android | 106 // TODO(wkorman): Rename Layout to UpdateLayerTreeHost in all Android |
114 // Compositor related classes. | 107 // Compositor related classes. |
115 } | 108 } |
116 | 109 |
117 void ContentViewRenderView::OnSwapBuffersCompleted(int pending_swap_buffers) { | 110 void ContentViewRenderView::OnSwapBuffersCompleted(int pending_swap_buffers) { |
118 JNIEnv* env = base::android::AttachCurrentThread(); | 111 JNIEnv* env = base::android::AttachCurrentThread(); |
119 Java_ContentViewRenderView_onSwapBuffersCompleted(env, java_obj_.obj()); | 112 Java_ContentViewRenderView_onSwapBuffersCompleted(env, java_obj_.obj()); |
120 } | 113 } |
121 | 114 |
122 void ContentViewRenderView::InitCompositor() { | 115 void ContentViewRenderView::InitCompositor() { |
123 if (!compositor_) | 116 if (!compositor_) |
124 compositor_.reset(Compositor::Create(this, root_window_)); | 117 compositor_.reset(Compositor::Create(this, root_window_)); |
125 } | 118 } |
126 | 119 |
127 jlong ContentViewRenderView::GetUIResourceProvider( | |
128 JNIEnv* env, | |
129 const JavaParamRef<jobject>& obj) { | |
130 if (!compositor_) | |
131 return 0; | |
132 return reinterpret_cast<intptr_t>(&compositor_->GetUIResourceProvider()); | |
133 } | |
134 } // namespace content | 120 } // namespace content |
OLD | NEW |