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

Side by Side Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 738983002: Move output surface fallback from cc to embedders (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years 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
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/renderer_host/compositor_impl_android.h" 5 #include "content/browser/renderer_host/compositor_impl_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 #include <android/native_window_jni.h> 8 #include <android/native_window_jni.h>
9 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 limits, 517 limits,
518 NULL)); 518 NULL));
519 } 519 }
520 520
521 void CompositorImpl::Layout() { 521 void CompositorImpl::Layout() {
522 ignore_schedule_composite_ = true; 522 ignore_schedule_composite_ = true;
523 client_->Layout(); 523 client_->Layout();
524 ignore_schedule_composite_ = false; 524 ignore_schedule_composite_ = false;
525 } 525 }
526 526
527 void CompositorImpl::RequestNewOutputSurface(bool fallback) { 527 void CompositorImpl::RequestNewOutputSurface() {
528 BrowserGpuChannelHostFactory* factory = 528 BrowserGpuChannelHostFactory* factory =
529 BrowserGpuChannelHostFactory::instance(); 529 BrowserGpuChannelHostFactory::instance();
530 if (!factory->GetGpuChannel() || factory->GetGpuChannel()->IsLost()) { 530 if (!factory->GetGpuChannel() || factory->GetGpuChannel()->IsLost()) {
531 CauseForGpuLaunch cause = 531 CauseForGpuLaunch cause =
532 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; 532 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE;
533 factory->EstablishGpuChannel( 533 factory->EstablishGpuChannel(
534 cause, 534 cause,
535 base::Bind(&CompositorImpl::CreateOutputSurface, 535 base::Bind(&CompositorImpl::CreateOutputSurface,
536 weak_factory_.GetWeakPtr(), 536 weak_factory_.GetWeakPtr()));
537 fallback));
538 return; 537 return;
539 } 538 }
540 539
541 CreateOutputSurface(fallback); 540 CreateOutputSurface();
542 } 541 }
543 542
544 void CompositorImpl::CreateOutputSurface(bool fallback) { 543 void CompositorImpl::DidFailToInitializeOutputSurface() {
544 RequestNewOutputSurface();
545 }
546
547 void CompositorImpl::CreateOutputSurface() {
545 blink::WebGraphicsContext3D::Attributes attrs; 548 blink::WebGraphicsContext3D::Attributes attrs;
546 attrs.shareResources = true; 549 attrs.shareResources = true;
547 attrs.noAutomaticFlushes = true; 550 attrs.noAutomaticFlushes = true;
548 pending_swapbuffers_ = 0; 551 pending_swapbuffers_ = 0;
549 552
550 DCHECK(window_); 553 DCHECK(window_);
551 DCHECK(surface_id_); 554 DCHECK(surface_id_);
552 555
553 scoped_refptr<ContextProviderCommandBuffer> context_provider; 556 scoped_refptr<ContextProviderCommandBuffer> context_provider;
554 BrowserGpuChannelHostFactory* factory = 557 BrowserGpuChannelHostFactory* factory =
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 } 679 }
677 680
678 void CompositorImpl::SetNeedsAnimate() { 681 void CompositorImpl::SetNeedsAnimate() {
679 if (!host_) 682 if (!host_)
680 return; 683 return;
681 684
682 host_->SetNeedsAnimate(); 685 host_->SetNeedsAnimate();
683 } 686 }
684 687
685 } // namespace content 688 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698