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

Side by Side Diff: content/browser/compositor/browser_compositor_view_mac.mm

Issue 326563003: Remove swap ack throttling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_some_nonca
Patch Set: Remove Aura methods Created 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/compositor/browser_compositor_view_mac.h" 5 #include "content/browser/compositor/browser_compositor_view_mac.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/mac/scoped_cftyperef.h" 8 #include "base/mac/scoped_cftyperef.h"
9 #include "content/browser/renderer_host/compositing_iosurface_context_mac.h" 9 #include "content/browser/renderer_host/compositing_iosurface_context_mac.h"
10 #include "content/browser/renderer_host/compositing_iosurface_mac.h" 10 #include "content/browser/renderer_host/compositing_iosurface_mac.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 - (void)gotSoftwareFrame:(cc::SoftwareFrameData*)frame_data 57 - (void)gotSoftwareFrame:(cc::SoftwareFrameData*)frame_data
58 withScaleFactor:(float)scale_factor 58 withScaleFactor:(float)scale_factor
59 withCanvas:(SkCanvas*)canvas { 59 withCanvas:(SkCanvas*)canvas {
60 DLOG(ERROR) << "-[NSView gotSoftwareFrame] called on non-overridden class."; 60 DLOG(ERROR) << "-[NSView gotSoftwareFrame] called on non-overridden class.";
61 } 61 }
62 62
63 @end // NSView (BrowserCompositorView) 63 @end // NSView (BrowserCompositorView)
64 64
65 @implementation BrowserCompositorViewMac : NSView 65 @implementation BrowserCompositorViewMac : NSView
66 66
67 - (id)initWithSuperview:(NSView*)view 67 - (id)initWithSuperview:(NSView*)view {
68 withClient:(content::BrowserCompositorViewMacClient*)client {
69 if (self = [super init]) { 68 if (self = [super init]) {
70 client_ = client;
71 helper_.reset(new content::BrowserCompositorViewMacHelper(self)); 69 helper_.reset(new content::BrowserCompositorViewMacHelper(self));
72 70
73 // Disable the fade-in animation as the layer and view are added. 71 // Disable the fade-in animation as the layer and view are added.
74 ScopedCAActionDisabler disabler; 72 ScopedCAActionDisabler disabler;
75 73
76 // Make this view host a transparent layer. 74 // Make this view host a transparent layer.
77 background_layer_.reset([[CALayer alloc] init]); 75 background_layer_.reset([[CALayer alloc] init]);
78 [background_layer_ setContentsGravity:kCAGravityTopLeft]; 76 [background_layer_ setContentsGravity:kCAGravityTopLeft];
79 [self setLayer:background_layer_]; 77 [self setLayer:background_layer_];
80 [self setWantsLayer:YES]; 78 [self setWantsLayer:YES];
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 132 }
135 133
136 // The content area of the software layer is the size of the image provided. 134 // The content area of the software layer is the size of the image provided.
137 // Make the bounds of the layer match the superview's bounds, to ensure that 135 // Make the bounds of the layer match the superview's bounds, to ensure that
138 // the visible contents are drawn. 136 // the visible contents are drawn.
139 [software_layer_ setBounds:new_background_frame]; 137 [software_layer_ setBounds:new_background_frame];
140 } 138 }
141 139
142 - (void)resetClient { 140 - (void)resetClient {
143 [accelerated_layer_ resetClient]; 141 [accelerated_layer_ resetClient];
144 client_ = NULL;
145 } 142 }
146 143
147 - (ui::Compositor*)compositor { 144 - (ui::Compositor*)compositor {
148 return compositor_.get(); 145 return compositor_.get();
149 } 146 }
150 147
151 - (void)gotAcceleratedIOSurfaceFrame:(uint64)surface_handle 148 - (void)gotAcceleratedIOSurfaceFrame:(uint64)surface_handle
152 withPixelSize:(gfx::Size)pixel_size 149 withPixelSize:(gfx::Size)pixel_size
153 withScaleFactor:(float)scale_factor { 150 withScaleFactor:(float)scale_factor {
154 ScopedCAActionDisabler disabler; 151 ScopedCAActionDisabler disabler;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 231
235 // This call can be nested insider ui::Compositor commit calls, and can also 232 // This call can be nested insider ui::Compositor commit calls, and can also
236 // make additional ui::Compositor commit calls. Avoid the potential recursion 233 // make additional ui::Compositor commit calls. Avoid the potential recursion
237 // by acknowledging the frame asynchronously. 234 // by acknowledging the frame asynchronously.
238 [self performSelector:@selector(layerDidDrawFrame) 235 [self performSelector:@selector(layerDidDrawFrame)
239 withObject:nil 236 withObject:nil
240 afterDelay:0]; 237 afterDelay:0];
241 } 238 }
242 239
243 - (void)layerDidDrawFrame { 240 - (void)layerDidDrawFrame {
244 if (client_)
245 client_->BrowserCompositorDidDrawFrame();
246 } 241 }
247 242
248 @end // BrowserCompositorViewMac 243 @end // BrowserCompositorViewMac
OLDNEW
« no previous file with comments | « content/browser/compositor/browser_compositor_view_mac.h ('k') | content/browser/compositor/delegated_frame_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698