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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 2040013002: Revert of mac: ensure ui::Compositor exists for visible RWHVs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm » ('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 (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/render_widget_host_view_mac.h" 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h"
6 6
7 #import <objc/runtime.h> 7 #import <objc/runtime.h>
8 #include <OpenGL/gl.h> 8 #include <OpenGL/gl.h>
9 #include <QuartzCore/QuartzCore.h> 9 #include <QuartzCore/QuartzCore.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 render_widget_host_->SetView(this); 593 render_widget_host_->SetView(this);
594 594
595 // Let the page-level input event router know about our surface ID 595 // Let the page-level input event router know about our surface ID
596 // namespace for surface-based hit testing. 596 // namespace for surface-based hit testing.
597 if (render_widget_host_->delegate() && 597 if (render_widget_host_->delegate() &&
598 render_widget_host_->delegate()->GetInputEventRouter()) { 598 render_widget_host_->delegate()->GetInputEventRouter()) {
599 render_widget_host_->delegate() 599 render_widget_host_->delegate()
600 ->GetInputEventRouter() 600 ->GetInputEventRouter()
601 ->AddSurfaceIdNamespaceOwner(GetSurfaceIdNamespace(), this); 601 ->AddSurfaceIdNamespaceOwner(GetSurfaceIdNamespace(), this);
602 } 602 }
603
604 if (!render_widget_host_->is_hidden())
605 EnsureBrowserCompositorView();
606 } 603 }
607 604
608 RenderWidgetHostViewMac::~RenderWidgetHostViewMac() { 605 RenderWidgetHostViewMac::~RenderWidgetHostViewMac() {
609 display::Screen::GetScreen()->RemoveObserver(this); 606 display::Screen::GetScreen()->RemoveObserver(this);
610 607
611 // This is being called from |cocoa_view_|'s destructor, so invalidate the 608 // This is being called from |cocoa_view_|'s destructor, so invalidate the
612 // pointer. 609 // pointer.
613 cocoa_view_ = nil; 610 cocoa_view_ = nil;
614 611
615 UnlockMouse(); 612 UnlockMouse();
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 if (frame->delegated_frame_data) { 1490 if (frame->delegated_frame_data) {
1494 float scale_factor = frame->metadata.device_scale_factor; 1491 float scale_factor = frame->metadata.device_scale_factor;
1495 1492
1496 // Compute the frame size based on the root render pass rect size. 1493 // Compute the frame size based on the root render pass rect size.
1497 cc::RenderPass* root_pass = 1494 cc::RenderPass* root_pass =
1498 frame->delegated_frame_data->render_pass_list.back().get(); 1495 frame->delegated_frame_data->render_pass_list.back().get();
1499 gfx::Size pixel_size = root_pass->output_rect.size(); 1496 gfx::Size pixel_size = root_pass->output_rect.size();
1500 gfx::Size dip_size = gfx::ConvertSizeToDIP(scale_factor, pixel_size); 1497 gfx::Size dip_size = gfx::ConvertSizeToDIP(scale_factor, pixel_size);
1501 1498
1502 root_layer_->SetBounds(gfx::Rect(dip_size)); 1499 root_layer_->SetBounds(gfx::Rect(dip_size));
1503 if (browser_compositor_ && browser_compositor_->compositor()) { 1500 if (!render_widget_host_->is_hidden()) {
1501 EnsureBrowserCompositorView();
1504 browser_compositor_->compositor()->SetScaleAndSize( 1502 browser_compositor_->compositor()->SetScaleAndSize(
1505 scale_factor, pixel_size); 1503 scale_factor, pixel_size);
1506 } 1504 }
1507 1505
1508 SendVSyncParametersToRenderer(); 1506 SendVSyncParametersToRenderer();
1509 1507
1510 delegated_frame_host_->SwapDelegatedFrame(output_surface_id, 1508 delegated_frame_host_->SwapDelegatedFrame(output_surface_id,
1511 std::move(frame)); 1509 std::move(frame));
1512 } else { 1510 } else {
1513 DLOG(ERROR) << "Received unexpected frame type."; 1511 DLOG(ERROR) << "Received unexpected frame type.";
(...skipping 1942 matching lines...) Expand 10 before | Expand all | Expand 10 after
3456 3454
3457 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3455 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3458 // regions that are not draggable. (See ControlRegionView in 3456 // regions that are not draggable. (See ControlRegionView in
3459 // native_app_window_cocoa.mm). This requires the render host view to be 3457 // native_app_window_cocoa.mm). This requires the render host view to be
3460 // draggable by default. 3458 // draggable by default.
3461 - (BOOL)mouseDownCanMoveWindow { 3459 - (BOOL)mouseDownCanMoveWindow {
3462 return YES; 3460 return YES;
3463 } 3461 }
3464 3462
3465 @end 3463 @end
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698