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

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

Issue 2449853004: Getting rid of DelegatedFrameData (Closed)
Patch Set: nit Created 4 years, 1 month 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/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 17 matching lines...) Expand all
28 #include "base/strings/string_util.h" 28 #include "base/strings/string_util.h"
29 #include "base/strings/stringprintf.h" 29 #include "base/strings/stringprintf.h"
30 #include "base/strings/sys_string_conversions.h" 30 #include "base/strings/sys_string_conversions.h"
31 #include "base/strings/utf_string_conversions.h" 31 #include "base/strings/utf_string_conversions.h"
32 #include "base/sys_info.h" 32 #include "base/sys_info.h"
33 #include "base/threading/thread_task_runner_handle.h" 33 #include "base/threading/thread_task_runner_handle.h"
34 #include "base/trace_event/trace_event.h" 34 #include "base/trace_event/trace_event.h"
35 #import "content/browser/accessibility/browser_accessibility_cocoa.h" 35 #import "content/browser/accessibility/browser_accessibility_cocoa.h"
36 #import "content/browser/accessibility/browser_accessibility_mac.h" 36 #import "content/browser/accessibility/browser_accessibility_mac.h"
37 #include "content/browser/accessibility/browser_accessibility_manager_mac.h" 37 #include "content/browser/accessibility/browser_accessibility_manager_mac.h"
38 #include "content/browser/bad_message.h"
39 #import "content/browser/cocoa/system_hotkey_helper_mac.h" 38 #import "content/browser/cocoa/system_hotkey_helper_mac.h"
40 #import "content/browser/cocoa/system_hotkey_map.h" 39 #import "content/browser/cocoa/system_hotkey_map.h"
41 #include "content/browser/frame_host/frame_tree.h" 40 #include "content/browser/frame_host/frame_tree.h"
42 #include "content/browser/frame_host/frame_tree_node.h" 41 #include "content/browser/frame_host/frame_tree_node.h"
43 #include "content/browser/frame_host/render_frame_host_impl.h" 42 #include "content/browser/frame_host/render_frame_host_impl.h"
44 #include "content/browser/gpu/compositor_util.h" 43 #include "content/browser/gpu/compositor_util.h"
45 #import "content/browser/renderer_host/input/synthetic_gesture_target_mac.h" 44 #import "content/browser/renderer_host/input/synthetic_gesture_target_mac.h"
46 #include "content/browser/renderer_host/input/web_input_event_builders_mac.h" 45 #include "content/browser/renderer_host/input/web_input_event_builders_mac.h"
47 #include "content/browser/renderer_host/render_view_host_impl.h" 46 #include "content/browser/renderer_host/render_view_host_impl.h"
48 #include "content/browser/renderer_host/render_widget_helper.h" 47 #include "content/browser/renderer_host/render_widget_helper.h"
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 1408
1410 void RenderWidgetHostViewMac::OnSwapCompositorFrame( 1409 void RenderWidgetHostViewMac::OnSwapCompositorFrame(
1411 uint32_t compositor_frame_sink_id, 1410 uint32_t compositor_frame_sink_id,
1412 cc::CompositorFrame frame) { 1411 cc::CompositorFrame frame) {
1413 TRACE_EVENT0("browser", "RenderWidgetHostViewMac::OnSwapCompositorFrame"); 1412 TRACE_EVENT0("browser", "RenderWidgetHostViewMac::OnSwapCompositorFrame");
1414 1413
1415 last_scroll_offset_ = frame.metadata.root_scroll_offset; 1414 last_scroll_offset_ = frame.metadata.root_scroll_offset;
1416 1415
1417 page_at_minimum_scale_ = 1416 page_at_minimum_scale_ =
1418 frame.metadata.page_scale_factor == frame.metadata.min_page_scale_factor; 1417 frame.metadata.page_scale_factor == frame.metadata.min_page_scale_factor;
1419 if (frame.delegated_frame_data) { 1418 browser_compositor_->SwapCompositorFrame(compositor_frame_sink_id,
1420 browser_compositor_->SwapCompositorFrame(compositor_frame_sink_id, 1419 std::move(frame));
1421 std::move(frame)); 1420 UpdateDisplayVSyncParameters();
1422 UpdateDisplayVSyncParameters();
1423 } else {
1424 DLOG(ERROR) << "Received unexpected frame type.";
1425 bad_message::ReceivedBadMessage(render_widget_host_->GetProcess(),
1426 bad_message::RWHVM_UNEXPECTED_FRAME_TYPE);
1427 }
1428 } 1421 }
1429 1422
1430 void RenderWidgetHostViewMac::ClearCompositorFrame() { 1423 void RenderWidgetHostViewMac::ClearCompositorFrame() {
1431 browser_compositor_->GetDelegatedFrameHost()->ClearDelegatedFrame(); 1424 browser_compositor_->GetDelegatedFrameHost()->ClearDelegatedFrame();
1432 } 1425 }
1433 1426
1434 gfx::Rect RenderWidgetHostViewMac::GetBoundsInRootWindow() { 1427 gfx::Rect RenderWidgetHostViewMac::GetBoundsInRootWindow() {
1435 // TODO(shess): In case of !window, the view has been removed from 1428 // TODO(shess): In case of !window, the view has been removed from
1436 // the view hierarchy because the tab isn't main. Could retrieve 1429 // the view hierarchy because the tab isn't main. Could retrieve
1437 // the information from the main tab for our window. 1430 // the information from the main tab for our window.
(...skipping 2007 matching lines...) Expand 10 before | Expand all | Expand 10 after
3445 3438
3446 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3439 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3447 // regions that are not draggable. (See ControlRegionView in 3440 // regions that are not draggable. (See ControlRegionView in
3448 // native_app_window_cocoa.mm). This requires the render host view to be 3441 // native_app_window_cocoa.mm). This requires the render host view to be
3449 // draggable by default. 3442 // draggable by default.
3450 - (BOOL)mouseDownCanMoveWindow { 3443 - (BOOL)mouseDownCanMoveWindow {
3451 return YES; 3444 return YES;
3452 } 3445 }
3453 3446
3454 @end 3447 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698