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

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

Issue 2752523008: Set compositor and CALayer background color from frames (Closed)
Patch Set: Created 3 years, 9 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 | 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/render_widget_host_view_mac.h" 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h"
6 6
7 #import <Carbon/Carbon.h> 7 #import <Carbon/Carbon.h>
8 #import <objc/runtime.h> 8 #import <objc/runtime.h>
9 #include <OpenGL/gl.h> 9 #include <OpenGL/gl.h>
10 #include <QuartzCore/QuartzCore.h> 10 #include <QuartzCore/QuartzCore.h>
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1424 NSRect bounds = NSRectFromCGRect(node_bounds_in_screen.ToCGRect()); 1424 NSRect bounds = NSRectFromCGRect(node_bounds_in_screen.ToCGRect());
1425 UAZoomChangeFocus(&bounds, NULL, kUAZoomFocusTypeOther); 1425 UAZoomChangeFocus(&bounds, NULL, kUAZoomFocusTypeOther);
1426 } 1426 }
1427 } 1427 }
1428 1428
1429 void RenderWidgetHostViewMac::OnSwapCompositorFrame( 1429 void RenderWidgetHostViewMac::OnSwapCompositorFrame(
1430 uint32_t compositor_frame_sink_id, 1430 uint32_t compositor_frame_sink_id,
1431 cc::CompositorFrame frame) { 1431 cc::CompositorFrame frame) {
1432 TRACE_EVENT0("browser", "RenderWidgetHostViewMac::OnSwapCompositorFrame"); 1432 TRACE_EVENT0("browser", "RenderWidgetHostViewMac::OnSwapCompositorFrame");
1433 1433
1434 // Override the compositor background color. See RenderWidgetHostViewAura
1435 // for more details.
1436 SetBackgroundColor(frame.metadata.root_background_color);
1437
1434 last_scroll_offset_ = frame.metadata.root_scroll_offset; 1438 last_scroll_offset_ = frame.metadata.root_scroll_offset;
1435 1439
1436 page_at_minimum_scale_ = 1440 page_at_minimum_scale_ =
1437 frame.metadata.page_scale_factor == frame.metadata.min_page_scale_factor; 1441 frame.metadata.page_scale_factor == frame.metadata.min_page_scale_factor;
1438 browser_compositor_->SwapCompositorFrame(compositor_frame_sink_id, 1442 browser_compositor_->SwapCompositorFrame(compositor_frame_sink_id,
1439 std::move(frame)); 1443 std::move(frame));
1440 UpdateDisplayVSyncParameters(); 1444 UpdateDisplayVSyncParameters();
1441 } 1445 }
1442 1446
1443 void RenderWidgetHostViewMac::ClearCompositorFrame() { 1447 void RenderWidgetHostViewMac::ClearCompositorFrame() {
(...skipping 2037 matching lines...) Expand 10 before | Expand all | Expand 10 after
3481 3485
3482 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3486 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3483 // regions that are not draggable. (See ControlRegionView in 3487 // regions that are not draggable. (See ControlRegionView in
3484 // native_app_window_cocoa.mm). This requires the render host view to be 3488 // native_app_window_cocoa.mm). This requires the render host view to be
3485 // draggable by default. 3489 // draggable by default.
3486 - (BOOL)mouseDownCanMoveWindow { 3490 - (BOOL)mouseDownCanMoveWindow {
3487 return YES; 3491 return YES;
3488 } 3492 }
3489 3493
3490 @end 3494 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698