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

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

Issue 2449853004: Getting rid of DelegatedFrameData (Closed)
Patch Set: 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 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 1400
1401 void RenderWidgetHostViewMac::OnSwapCompositorFrame( 1401 void RenderWidgetHostViewMac::OnSwapCompositorFrame(
1402 uint32_t compositor_frame_sink_id, 1402 uint32_t compositor_frame_sink_id,
1403 cc::CompositorFrame frame) { 1403 cc::CompositorFrame frame) {
1404 TRACE_EVENT0("browser", "RenderWidgetHostViewMac::OnSwapCompositorFrame"); 1404 TRACE_EVENT0("browser", "RenderWidgetHostViewMac::OnSwapCompositorFrame");
1405 1405
1406 last_scroll_offset_ = frame.metadata.root_scroll_offset; 1406 last_scroll_offset_ = frame.metadata.root_scroll_offset;
1407 1407
1408 page_at_minimum_scale_ = 1408 page_at_minimum_scale_ =
1409 frame.metadata.page_scale_factor == frame.metadata.min_page_scale_factor; 1409 frame.metadata.page_scale_factor == frame.metadata.min_page_scale_factor;
1410 if (frame.delegated_frame_data) { 1410 browser_compositor_->SwapCompositorFrame(compositor_frame_sink_id,
1411 browser_compositor_->SwapCompositorFrame(compositor_frame_sink_id, 1411 std::move(frame));
1412 std::move(frame)); 1412 UpdateDisplayVSyncParameters();
1413 UpdateDisplayVSyncParameters();
1414 } else {
1415 DLOG(ERROR) << "Received unexpected frame type.";
1416 bad_message::ReceivedBadMessage(render_widget_host_->GetProcess(),
1417 bad_message::RWHVM_UNEXPECTED_FRAME_TYPE);
boliu 2016/10/25 23:00:30 you can mark this enum as unused in bad_message.h,
1418 }
1419 } 1413 }
1420 1414
1421 void RenderWidgetHostViewMac::ClearCompositorFrame() { 1415 void RenderWidgetHostViewMac::ClearCompositorFrame() {
1422 browser_compositor_->GetDelegatedFrameHost()->ClearDelegatedFrame(); 1416 browser_compositor_->GetDelegatedFrameHost()->ClearDelegatedFrame();
1423 } 1417 }
1424 1418
1425 gfx::Rect RenderWidgetHostViewMac::GetBoundsInRootWindow() { 1419 gfx::Rect RenderWidgetHostViewMac::GetBoundsInRootWindow() {
1426 // TODO(shess): In case of !window, the view has been removed from 1420 // TODO(shess): In case of !window, the view has been removed from
1427 // the view hierarchy because the tab isn't main. Could retrieve 1421 // the view hierarchy because the tab isn't main. Could retrieve
1428 // the information from the main tab for our window. 1422 // the information from the main tab for our window.
(...skipping 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after
3412 3406
3413 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3407 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3414 // regions that are not draggable. (See ControlRegionView in 3408 // regions that are not draggable. (See ControlRegionView in
3415 // native_app_window_cocoa.mm). This requires the render host view to be 3409 // native_app_window_cocoa.mm). This requires the render host view to be
3416 // draggable by default. 3410 // draggable by default.
3417 - (BOOL)mouseDownCanMoveWindow { 3411 - (BOOL)mouseDownCanMoveWindow {
3418 return YES; 3412 return YES;
3419 } 3413 }
3420 3414
3421 @end 3415 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698