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

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

Issue 1921533008: Add support for OutputSurface for Vulkan on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix rebase error. Created 4 years, 7 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 | « content/browser/renderer_host/compositor_impl_android.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 17 matching lines...) Expand all
28 #include "base/threading/simple_thread.h" 28 #include "base/threading/simple_thread.h"
29 #include "base/threading/thread.h" 29 #include "base/threading/thread.h"
30 #include "base/threading/thread_checker.h" 30 #include "base/threading/thread_checker.h"
31 #include "cc/base/switches.h" 31 #include "cc/base/switches.h"
32 #include "cc/input/input_handler.h" 32 #include "cc/input/input_handler.h"
33 #include "cc/layers/layer.h" 33 #include "cc/layers/layer.h"
34 #include "cc/output/compositor_frame.h" 34 #include "cc/output/compositor_frame.h"
35 #include "cc/output/context_provider.h" 35 #include "cc/output/context_provider.h"
36 #include "cc/output/output_surface.h" 36 #include "cc/output/output_surface.h"
37 #include "cc/output/output_surface_client.h" 37 #include "cc/output/output_surface_client.h"
38 #include "cc/output/vulkan_in_process_context_provider.h"
38 #include "cc/raster/single_thread_task_graph_runner.h" 39 #include "cc/raster/single_thread_task_graph_runner.h"
39 #include "cc/scheduler/begin_frame_source.h" 40 #include "cc/scheduler/begin_frame_source.h"
40 #include "cc/surfaces/onscreen_display_client.h" 41 #include "cc/surfaces/onscreen_display_client.h"
41 #include "cc/surfaces/surface_display_output_surface.h" 42 #include "cc/surfaces/surface_display_output_surface.h"
42 #include "cc/surfaces/surface_id_allocator.h" 43 #include "cc/surfaces/surface_id_allocator.h"
43 #include "cc/surfaces/surface_manager.h" 44 #include "cc/surfaces/surface_manager.h"
44 #include "cc/trees/layer_tree_host.h" 45 #include "cc/trees/layer_tree_host.h"
45 #include "cc/trees/layer_tree_settings.h" 46 #include "cc/trees/layer_tree_settings.h"
46 #include "components/display_compositor/compositor_overlay_candidate_validator_a ndroid.h" 47 #include "components/display_compositor/compositor_overlay_candidate_validator_a ndroid.h"
47 #include "components/display_compositor/gl_helper.h" 48 #include "components/display_compositor/gl_helper.h"
48 #include "content/browser/android/child_process_launcher_android.h" 49 #include "content/browser/android/child_process_launcher_android.h"
49 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 50 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
50 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" 51 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
51 #include "content/browser/gpu/compositor_util.h" 52 #include "content/browser/gpu/compositor_util.h"
52 #include "content/browser/gpu/gpu_surface_tracker.h" 53 #include "content/browser/gpu/gpu_surface_tracker.h"
53 #include "content/browser/renderer_host/render_widget_host_impl.h" 54 #include "content/browser/renderer_host/render_widget_host_impl.h"
54 #include "content/common/gpu/client/context_provider_command_buffer.h" 55 #include "content/common/gpu/client/context_provider_command_buffer.h"
55 #include "content/common/gpu_process_launch_causes.h" 56 #include "content/common/gpu_process_launch_causes.h"
56 #include "content/common/host_shared_bitmap_manager.h" 57 #include "content/common/host_shared_bitmap_manager.h"
57 #include "content/public/browser/android/compositor.h" 58 #include "content/public/browser/android/compositor.h"
58 #include "content/public/browser/android/compositor_client.h" 59 #include "content/public/browser/android/compositor_client.h"
59 #include "content/public/common/content_switches.h" 60 #include "content/public/common/content_switches.h"
60 #include "gpu/command_buffer/client/context_support.h" 61 #include "gpu/command_buffer/client/context_support.h"
61 #include "gpu/command_buffer/client/gles2_interface.h" 62 #include "gpu/command_buffer/client/gles2_interface.h"
62 #include "gpu/ipc/client/command_buffer_proxy_impl.h" 63 #include "gpu/ipc/client/command_buffer_proxy_impl.h"
63 #include "gpu/ipc/client/gpu_channel_host.h" 64 #include "gpu/ipc/client/gpu_channel_host.h"
65 #include "gpu/vulkan/vulkan_surface.h"
64 #include "third_party/khronos/GLES2/gl2.h" 66 #include "third_party/khronos/GLES2/gl2.h"
65 #include "third_party/khronos/GLES2/gl2ext.h" 67 #include "third_party/khronos/GLES2/gl2ext.h"
66 #include "third_party/skia/include/core/SkMallocPixelRef.h" 68 #include "third_party/skia/include/core/SkMallocPixelRef.h"
67 #include "ui/android/window_android.h" 69 #include "ui/android/window_android.h"
68 #include "ui/gfx/android/device_display_info.h" 70 #include "ui/gfx/android/device_display_info.h"
69 #include "ui/gfx/swap_result.h" 71 #include "ui/gfx/swap_result.h"
70 72
71 namespace content { 73 namespace content {
72 74
73 namespace { 75 namespace {
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 private: 216 private:
215 CompositorImpl* compositor_; 217 CompositorImpl* compositor_;
216 base::Callback<void(gpu::Capabilities)> populate_gpu_capabilities_callback_; 218 base::Callback<void(gpu::Capabilities)> populate_gpu_capabilities_callback_;
217 base::CancelableCallback<void(const std::vector<ui::LatencyInfo>&, 219 base::CancelableCallback<void(const std::vector<ui::LatencyInfo>&,
218 gfx::SwapResult)> 220 gfx::SwapResult)>
219 swap_buffers_completion_callback_; 221 swap_buffers_completion_callback_;
220 std::unique_ptr<cc::OverlayCandidateValidator> overlay_candidate_validator_; 222 std::unique_ptr<cc::OverlayCandidateValidator> overlay_candidate_validator_;
221 std::unique_ptr<ExternalBeginFrameSource> begin_frame_source_; 223 std::unique_ptr<ExternalBeginFrameSource> begin_frame_source_;
222 }; 224 };
223 225
226 #if defined(ENABLE_VULKAN)
227 class VulkanOutputSurface : public cc::OutputSurface {
228 public:
229 VulkanOutputSurface(
230 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider)
231 : OutputSurface(nullptr,
232 nullptr,
233 std::move(vulkan_context_provider),
234 nullptr) {}
235
236 ~VulkanOutputSurface() override { Destroy(); }
237
238 bool Initialize(gfx::AcceleratedWidget widget) {
239 DCHECK(!surface_);
240 std::unique_ptr<gpu::VulkanSurface> surface(
241 gpu::VulkanSurface::CreateViewSurface(widget));
242 if (!surface->Initialize(vulkan_context_provider()->GetDeviceQueue(),
243 gpu::VulkanSurface::DEFAULT_SURFACE_FORMAT)) {
244 return false;
245 }
246 surface_ = std::move(surface);
247
248 return true;
249 }
250
251 void SwapBuffers(cc::CompositorFrame* frame) override {
252 surface_->SwapBuffers();
253 PostSwapBuffersComplete();
254 client_->DidSwapBuffers();
255 }
256
257 void Destroy() {
258 if (surface_) {
259 surface_->Destroy();
260 surface_.reset();
261 }
262 }
263
264 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info,
265 gfx::SwapResult result) {
266 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info);
267 OutputSurface::OnSwapBuffersComplete();
268 }
269
270 private:
271 std::unique_ptr<gpu::VulkanSurface> surface_;
272
273 DISALLOW_COPY_AND_ASSIGN(VulkanOutputSurface);
274 };
275 #endif
276
277 base::LazyInstance<scoped_refptr<cc::VulkanInProcessContextProvider>>
278 g_shared_vulkan_context_provider_android_ = LAZY_INSTANCE_INITIALIZER;
279
224 static bool g_initialized = false; 280 static bool g_initialized = false;
225 281
226 base::LazyInstance<cc::SurfaceManager> g_surface_manager = 282 base::LazyInstance<cc::SurfaceManager> g_surface_manager =
227 LAZY_INSTANCE_INITIALIZER; 283 LAZY_INSTANCE_INITIALIZER;
228 284
229 int g_surface_id_namespace = 0; 285 int g_surface_id_namespace = 0;
230 286
231 class SingleThreadTaskGraphRunner : public cc::SingleThreadTaskGraphRunner { 287 class SingleThreadTaskGraphRunner : public cc::SingleThreadTaskGraphRunner {
232 public: 288 public:
233 SingleThreadTaskGraphRunner() { 289 SingleThreadTaskGraphRunner() {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 std::unique_ptr<cc::SurfaceIdAllocator> 326 std::unique_ptr<cc::SurfaceIdAllocator>
271 CompositorImpl::CreateSurfaceIdAllocator() { 327 CompositorImpl::CreateSurfaceIdAllocator() {
272 std::unique_ptr<cc::SurfaceIdAllocator> allocator( 328 std::unique_ptr<cc::SurfaceIdAllocator> allocator(
273 new cc::SurfaceIdAllocator(++g_surface_id_namespace)); 329 new cc::SurfaceIdAllocator(++g_surface_id_namespace));
274 cc::SurfaceManager* manager = GetSurfaceManager(); 330 cc::SurfaceManager* manager = GetSurfaceManager();
275 DCHECK(manager); 331 DCHECK(manager);
276 allocator->RegisterSurfaceIdNamespace(manager); 332 allocator->RegisterSurfaceIdNamespace(manager);
277 return allocator; 333 return allocator;
278 } 334 }
279 335
336 // static
337 scoped_refptr<cc::VulkanInProcessContextProvider>
338 CompositorImpl::SharedVulkanContextProviderAndroid() {
339 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
340 switches::kEnableVulkan)) {
341 scoped_refptr<cc::VulkanInProcessContextProvider>* context_provider =
342 g_shared_vulkan_context_provider_android_.Pointer();
343 if (*context_provider == NULL)
344 *context_provider = cc::VulkanInProcessContextProvider::Create();
345 return *context_provider;
346 }
347 return nullptr;
348 }
349
280 CompositorImpl::CompositorImpl(CompositorClient* client, 350 CompositorImpl::CompositorImpl(CompositorClient* client,
281 gfx::NativeWindow root_window) 351 gfx::NativeWindow root_window)
282 : root_layer_(cc::Layer::Create()), 352 : root_layer_(cc::Layer::Create()),
283 surface_id_allocator_(CreateSurfaceIdAllocator()), 353 surface_id_allocator_(CreateSurfaceIdAllocator()),
284 resource_manager_(root_window), 354 resource_manager_(root_window),
285 has_transparent_background_(false), 355 has_transparent_background_(false),
286 device_scale_factor_(1), 356 device_scale_factor_(1),
287 window_(NULL), 357 window_(NULL),
288 surface_handle_(gpu::kNullSurfaceHandle), 358 surface_handle_(gpu::kNullSurfaceHandle),
289 client_(client), 359 client_(client),
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 RequestNewOutputSurface(); 570 RequestNewOutputSurface();
501 } 571 }
502 572
503 void CompositorImpl::CreateOutputSurface() { 573 void CompositorImpl::CreateOutputSurface() {
504 // We might have had a request from a LayerTreeHost that was then 574 // We might have had a request from a LayerTreeHost that was then
505 // hidden (and hidden means we don't have a native surface). 575 // hidden (and hidden means we don't have a native surface).
506 // Also make sure we only handle this once. 576 // Also make sure we only handle this once.
507 if (!output_surface_request_pending_ || !host_->visible()) 577 if (!output_surface_request_pending_ || !host_->visible())
508 return; 578 return;
509 579
510 // This is used for the browser compositor (offscreen) and for the display 580 scoped_refptr<ContextProviderCommandBuffer> context_provider;
511 // compositor (onscreen), so ask for capabilities needed by either one. 581 scoped_refptr<cc::VulkanInProcessContextProvider> vulkan_context_provider =
512 // The default framebuffer for an offscreen context is not used, so it does 582 SharedVulkanContextProviderAndroid();
513 // not need alpha, stencil, depth, antialiasing. The display compositor does 583 std::unique_ptr<cc::OutputSurface> real_output_surface;
514 // not use these things either, except for alpha when it has a transparent 584 #if defined(ENABLE_VULKAN)
515 // background. 585 std::unique_ptr<VulkanOutputSurface> vulkan_surface;
516 gpu::gles2::ContextCreationAttribHelper attributes; 586 if (vulkan_context_provider) {
517 attributes.alpha_size = -1; 587 vulkan_surface.reset(
518 attributes.stencil_size = 0; 588 new VulkanOutputSurface(std::move(vulkan_context_provider)));
519 attributes.depth_size = 0; 589 if (!vulkan_surface->Initialize(window_)) {
520 attributes.samples = 0; 590 vulkan_surface->Destroy();
521 attributes.sample_buffers = 0; 591 vulkan_surface.reset();
522 attributes.bind_generates_resource = false; 592 } else {
593 real_output_surface = std::move(vulkan_surface);
594 }
595 }
596 #endif
523 597
524 if (has_transparent_background_) { 598 if (!real_output_surface) {
525 attributes.alpha_size = 8; 599 // This is used for the browser compositor (offscreen) and for the display
526 } else if (base::SysInfo::IsLowEndDevice()) { 600 // compositor (onscreen), so ask for capabilities needed by either one.
527 // In this case we prefer to use RGB565 format instead of RGBA8888 if 601 // The default framebuffer for an offscreen context is not used, so it does
528 // possible. 602 // not need alpha, stencil, depth, antialiasing. The display compositor does
529 // TODO(danakj): GpuCommandBufferStub constructor checks for alpha == 0 in 603 // not use these things either, except for alpha when it has a transparent
530 // order to enable 565, but it should avoid using 565 when -1s are specified 604 // background.
531 // (IOW check that a <= 0 && rgb > 0 && rgb <= 565) then alpha should be -1. 605 gpu::gles2::ContextCreationAttribHelper attributes;
532 attributes.alpha_size = 0; 606 attributes.alpha_size = -1;
533 attributes.red_size = 5; 607 attributes.stencil_size = 0;
534 attributes.green_size = 6; 608 attributes.depth_size = 0;
535 attributes.blue_size = 5; 609 attributes.samples = 0;
610 attributes.sample_buffers = 0;
611 attributes.bind_generates_resource = false;
612
613 if (has_transparent_background_) {
614 attributes.alpha_size = 8;
615 } else if (base::SysInfo::IsLowEndDevice()) {
616 // In this case we prefer to use RGB565 format instead of RGBA8888 if
617 // possible.
618 // TODO(danakj): GpuCommandBufferStub constructor checks for alpha == 0 in
619 // order to enable 565, but it should avoid using 565 when -1s are
620 // specified
621 // (IOW check that a <= 0 && rgb > 0 && rgb <= 565) then alpha should be
622 // -1.
623 attributes.alpha_size = 0;
624 attributes.red_size = 5;
625 attributes.green_size = 6;
626 attributes.blue_size = 5;
627 }
628
629 pending_swapbuffers_ = 0;
630
631 DCHECK(window_);
632 DCHECK_NE(surface_handle_, gpu::kNullSurfaceHandle);
633
634 BrowserGpuChannelHostFactory* factory =
635 BrowserGpuChannelHostFactory::instance();
636 // This channel might be lost (and even if it isn't right now, it might
637 // still get marked as lost from the IO thread, at any point in time
638 // really).
639 // But from here on just try and always lead to either
640 // DidInitializeOutputSurface() or DidFailToInitializeOutputSurface().
641 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host(
642 factory->GetGpuChannel());
643
644 GURL url("chrome://gpu/CompositorImpl::CreateOutputSurface");
645 constexpr bool automatic_flushes = false;
646
647 constexpr size_t kBytesPerPixel = 4;
648 const size_t full_screen_texture_size_in_bytes =
649 gfx::DeviceDisplayInfo().GetDisplayHeight() *
650 gfx::DeviceDisplayInfo().GetDisplayWidth() * kBytesPerPixel;
651
652 gpu::SharedMemoryLimits limits;
653 // This limit is meant to hold the contents of the display compositor
654 // drawing the scene. See discussion here:
655 // https://codereview.chromium.org/1900993002/diff/90001/content/browser/ren derer_host/compositor_impl_android.cc?context=3&column_width=80&tab_spaces=8
656 limits.command_buffer_size = 64 * 1024;
657 // These limits are meant to hold the uploads for the browser UI without
658 // any excess space.
659 limits.start_transfer_buffer_size = 64 * 1024;
660 limits.min_transfer_buffer_size = 64 * 1024;
661 limits.max_transfer_buffer_size = full_screen_texture_size_in_bytes;
662 // Texture uploads may use mapped memory so give a reasonable limit for
663 // them.
664 limits.mapped_memory_reclaim_limit = full_screen_texture_size_in_bytes;
665
666 context_provider = new ContextProviderCommandBuffer(
667 std::move(gpu_channel_host), surface_handle_, url,
668 gfx::PreferIntegratedGpu, automatic_flushes, limits, attributes,
669 nullptr, command_buffer_metrics::DISPLAY_COMPOSITOR_ONSCREEN_CONTEXT);
670 DCHECK(context_provider.get());
671
672 real_output_surface = base::WrapUnique(new OutputSurfaceWithoutParent(
673 this, context_provider,
674 base::Bind(&CompositorImpl::PopulateGpuCapabilities,
675 base::Unretained(this)),
676 base::WrapUnique(new ExternalBeginFrameSource(this))));
536 } 677 }
537 678
538 pending_swapbuffers_ = 0;
539
540 DCHECK(window_);
541 DCHECK_NE(surface_handle_, gpu::kNullSurfaceHandle);
542
543 BrowserGpuChannelHostFactory* factory =
544 BrowserGpuChannelHostFactory::instance();
545 // This channel might be lost (and even if it isn't right now, it might
546 // still get marked as lost from the IO thread, at any point in time really).
547 // But from here on just try and always lead to either
548 // DidInitializeOutputSurface() or DidFailToInitializeOutputSurface().
549 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host(factory->GetGpuChannel());
550
551 GURL url("chrome://gpu/CompositorImpl::CreateOutputSurface");
552 constexpr bool automatic_flushes = false;
553
554 constexpr size_t kBytesPerPixel = 4;
555 const size_t full_screen_texture_size_in_bytes =
556 gfx::DeviceDisplayInfo().GetDisplayHeight() *
557 gfx::DeviceDisplayInfo().GetDisplayWidth() * kBytesPerPixel;
558
559 gpu::SharedMemoryLimits limits;
560 // This limit is meant to hold the contents of the display compositor
561 // drawing the scene. See discussion here:
562 // https://codereview.chromium.org/1900993002/diff/90001/content/browser/rende rer_host/compositor_impl_android.cc?context=3&column_width=80&tab_spaces=8
563 limits.command_buffer_size = 64 * 1024;
564 // These limits are meant to hold the uploads for the browser UI without
565 // any excess space.
566 limits.start_transfer_buffer_size = 64 * 1024;
567 limits.min_transfer_buffer_size = 64 * 1024;
568 limits.max_transfer_buffer_size = full_screen_texture_size_in_bytes;
569 // Texture uploads may use mapped memory so give a reasonable limit for them.
570 limits.mapped_memory_reclaim_limit = full_screen_texture_size_in_bytes;
571
572 scoped_refptr<ContextProviderCommandBuffer> context_provider(
573 new ContextProviderCommandBuffer(
574 std::move(gpu_channel_host), surface_handle_, url,
575 gfx::PreferIntegratedGpu, automatic_flushes, limits, attributes,
576 nullptr,
577 command_buffer_metrics::DISPLAY_COMPOSITOR_ONSCREEN_CONTEXT));
578 DCHECK(context_provider.get());
579
580 std::unique_ptr<cc::OutputSurface> real_output_surface(
581 new OutputSurfaceWithoutParent(
582 this, context_provider,
583 base::Bind(&CompositorImpl::PopulateGpuCapabilities,
584 base::Unretained(this)),
585 base::WrapUnique(new ExternalBeginFrameSource(this))));
586
587 cc::SurfaceManager* manager = GetSurfaceManager(); 679 cc::SurfaceManager* manager = GetSurfaceManager();
588 display_client_.reset(new cc::OnscreenDisplayClient( 680 display_client_.reset(new cc::OnscreenDisplayClient(
589 std::move(real_output_surface), manager, 681 std::move(real_output_surface), manager,
590 HostSharedBitmapManager::current(), 682 HostSharedBitmapManager::current(),
591 BrowserGpuMemoryBufferManager::current(), 683 BrowserGpuMemoryBufferManager::current(),
592 host_->settings().renderer_settings, base::ThreadTaskRunnerHandle::Get(), 684 host_->settings().renderer_settings, base::ThreadTaskRunnerHandle::Get(),
593 surface_id_allocator_->id_namespace())); 685 surface_id_allocator_->id_namespace()));
686
594 std::unique_ptr<cc::SurfaceDisplayOutputSurface> surface_output_surface( 687 std::unique_ptr<cc::SurfaceDisplayOutputSurface> surface_output_surface(
595 new cc::SurfaceDisplayOutputSurface(manager, surface_id_allocator_.get(), 688 vulkan_context_provider
596 context_provider, nullptr)); 689 ? new cc::SurfaceDisplayOutputSurface(
690 manager, surface_id_allocator_.get(),
691 static_cast<scoped_refptr<cc::VulkanContextProvider>>(
692 vulkan_context_provider))
693 : new cc::SurfaceDisplayOutputSurface(manager,
694 surface_id_allocator_.get(),
695 context_provider, nullptr));
597 696
598 display_client_->set_surface_output_surface(surface_output_surface.get()); 697 display_client_->set_surface_output_surface(surface_output_surface.get());
599 surface_output_surface->set_display_client(display_client_.get()); 698 surface_output_surface->set_display_client(display_client_.get());
600 display_client_->display()->Resize(size_); 699 display_client_->display()->Resize(size_);
601 host_->SetOutputSurface(std::move(surface_output_surface)); 700 host_->SetOutputSurface(std::move(surface_output_surface));
602 } 701 }
603 702
604 void CompositorImpl::PopulateGpuCapabilities( 703 void CompositorImpl::PopulateGpuCapabilities(
605 gpu::Capabilities gpu_capabilities) { 704 gpu::Capabilities gpu_capabilities) {
606 gpu_capabilities_ = gpu_capabilities; 705 gpu_capabilities_ = gpu_capabilities;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 void CompositorImpl::SetNeedsAnimate() { 779 void CompositorImpl::SetNeedsAnimate() {
681 needs_animate_ = true; 780 needs_animate_ = true;
682 if (!host_->visible()) 781 if (!host_->visible())
683 return; 782 return;
684 783
685 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); 784 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate");
686 host_->SetNeedsAnimate(); 785 host_->SetNeedsAnimate();
687 } 786 }
688 787
689 } // namespace content 788 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698