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

Side by Side Diff: content/browser/android/in_process/synchronous_compositor_impl.cc

Issue 1073893004: Fix blank video in Android WebView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/android/in_process/synchronous_compositor_output_surface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/in_process/synchronous_compositor_impl.h" 5 #include "content/browser/android/in_process/synchronous_compositor_impl.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 contents_->GetRenderWidgetHostView()); 209 contents_->GetRenderWidgetHostView());
210 if (rwhv) 210 if (rwhv)
211 rwhv->SynchronousFrameMetadata(frame_metadata); 211 rwhv->SynchronousFrameMetadata(frame_metadata);
212 DeliverMessages(); 212 DeliverMessages();
213 } 213 }
214 214
215 void SynchronousCompositorImpl::SetMemoryPolicy(size_t bytes_limit) { 215 void SynchronousCompositorImpl::SetMemoryPolicy(size_t bytes_limit) {
216 DCHECK(CalledOnValidThread()); 216 DCHECK(CalledOnValidThread());
217 DCHECK(output_surface_); 217 DCHECK(output_surface_);
218 218
219 size_t current_bytes_limit = output_surface_->GetMemoryPolicy();
219 output_surface_->SetMemoryPolicy(bytes_limit); 220 output_surface_->SetMemoryPolicy(bytes_limit);
221
222 if (bytes_limit && !current_bytes_limit) {
223 g_factory.Get().CompositorInitializedHardwareDraw();
224 } else if (!bytes_limit && current_bytes_limit) {
225 g_factory.Get().CompositorReleasedHardwareDraw();
226 }
220 } 227 }
221 228
222 void SynchronousCompositorImpl::PostInvalidate() { 229 void SynchronousCompositorImpl::PostInvalidate() {
223 DCHECK(CalledOnValidThread()); 230 DCHECK(CalledOnValidThread());
224 DCHECK(compositor_client_); 231 DCHECK(compositor_client_);
225 compositor_client_->PostInvalidate(); 232 compositor_client_->PostInvalidate();
226 } 233 }
227 234
228 void SynchronousCompositorImpl::DidChangeRootLayerScrollOffset() { 235 void SynchronousCompositorImpl::DidChangeRootLayerScrollOffset() {
229 if (input_handler_) 236 if (input_handler_)
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 g_factory.Get(); // Ensure it's initialized. 368 g_factory.Get(); // Ensure it's initialized.
362 SynchronousCompositorImpl::CreateForWebContents(contents); 369 SynchronousCompositorImpl::CreateForWebContents(contents);
363 } 370 }
364 SynchronousCompositorImpl* instance = 371 SynchronousCompositorImpl* instance =
365 SynchronousCompositorImpl::FromWebContents(contents); 372 SynchronousCompositorImpl::FromWebContents(contents);
366 DCHECK(instance); 373 DCHECK(instance);
367 instance->SetClient(client); 374 instance->SetClient(client);
368 } 375 }
369 376
370 } // namespace content 377 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/android/in_process/synchronous_compositor_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698