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

Side by Side Diff: content/browser/android/content_view_render_view.cc

Issue 504553002: [Android] Expose method for UI to force composites (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: null check compositor_ Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 if (current_surface_format_ != format) { 113 if (current_surface_format_ != format) {
114 current_surface_format_ = format; 114 current_surface_format_ = format;
115 compositor_->SetSurface(surface); 115 compositor_->SetSurface(surface);
116 } 116 }
117 compositor_->SetWindowBounds(gfx::Size(width, height)); 117 compositor_->SetWindowBounds(gfx::Size(width, height));
118 } 118 }
119 119
120 void ContentViewRenderView::SetOverlayVideoMode( 120 void ContentViewRenderView::SetOverlayVideoMode(
121 JNIEnv* env, jobject obj, bool enabled) { 121 JNIEnv* env, jobject obj, bool enabled) {
122 compositor_->SetHasTransparentBackground(enabled); 122 compositor_->SetHasTransparentBackground(enabled);
123 SetNeedsComposite(env, obj);
124 }
125
126 void ContentViewRenderView::SetNeedsComposite(JNIEnv* env, jobject obj) {
127 if (compositor_)
128 compositor_->SetNeedsComposite();
123 } 129 }
124 130
125 void ContentViewRenderView::Layout() { 131 void ContentViewRenderView::Layout() {
126 JNIEnv* env = base::android::AttachCurrentThread(); 132 JNIEnv* env = base::android::AttachCurrentThread();
127 Java_ContentViewRenderView_onCompositorLayout(env, java_obj_.obj()); 133 Java_ContentViewRenderView_onCompositorLayout(env, java_obj_.obj());
128 } 134 }
129 135
130 void ContentViewRenderView::OnSwapBuffersCompleted(int pending_swap_buffers) { 136 void ContentViewRenderView::OnSwapBuffersCompleted(int pending_swap_buffers) {
131 JNIEnv* env = base::android::AttachCurrentThread(); 137 JNIEnv* env = base::android::AttachCurrentThread();
132 Java_ContentViewRenderView_onSwapBuffersCompleted(env, java_obj_.obj()); 138 Java_ContentViewRenderView_onSwapBuffersCompleted(env, java_obj_.obj());
133 } 139 }
134 140
135 void ContentViewRenderView::InitCompositor() { 141 void ContentViewRenderView::InitCompositor() {
136 if (!compositor_) 142 if (!compositor_)
137 compositor_.reset(Compositor::Create(this, root_window_)); 143 compositor_.reset(Compositor::Create(this, root_window_));
138 } 144 }
139 } // namespace content 145 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698