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

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

Issue 421483003: Parameterize TaskRunner used by ui::Compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@task_runner
Patch Set: Add missing includes Created 6 years, 5 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/compositor/software_browser_compositor_output_surface_unittest.cc » ('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 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_private_mac.h" 5 #include "content/browser/compositor/browser_compositor_view_private_mac.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/message_loop/message_loop.h"
8 #include "content/browser/compositor/gpu_process_transport_factory.h" 9 #include "content/browser/compositor/gpu_process_transport_factory.h"
9 #include "content/browser/renderer_host/compositing_iosurface_context_mac.h" 10 #include "content/browser/renderer_host/compositing_iosurface_context_mac.h"
10 #include "content/browser/renderer_host/compositing_iosurface_mac.h" 11 #include "content/browser/renderer_host/compositing_iosurface_mac.h"
11 #include "content/browser/renderer_host/software_layer_mac.h" 12 #include "content/browser/renderer_host/software_layer_mac.h"
12 #include "content/public/browser/context_factory.h" 13 #include "content/public/browser/context_factory.h"
13 #include "ui/base/cocoa/animation_utils.h" 14 #include "ui/base/cocoa/animation_utils.h"
14 #include "ui/gl/scoped_cgl.h" 15 #include "ui/gl/scoped_cgl.h"
15 16
16 //////////////////////////////////////////////////////////////////////////////// 17 ////////////////////////////////////////////////////////////////////////////////
17 // BrowserCompositorViewMacInternal 18 // BrowserCompositorViewMacInternal
(...skipping 14 matching lines...) Expand all
32 [flipped_layer_ setAnchorPoint:CGPointMake(0, 0)]; 33 [flipped_layer_ setAnchorPoint:CGPointMake(0, 0)];
33 [flipped_layer_ 34 [flipped_layer_
34 setAutoresizingMask:kCALayerWidthSizable|kCALayerHeightSizable]; 35 setAutoresizingMask:kCALayerWidthSizable|kCALayerHeightSizable];
35 36
36 // Set the Cocoa view to be hosting the un-flipped background layer (hosting 37 // Set the Cocoa view to be hosting the un-flipped background layer (hosting
37 // a flipped layer results in unpredictable behavior). 38 // a flipped layer results in unpredictable behavior).
38 cocoa_view_.reset([[BrowserCompositorViewCocoa alloc] initWithClient:this]); 39 cocoa_view_.reset([[BrowserCompositorViewCocoa alloc] initWithClient:this]);
39 40
40 // Create a compositor to draw the contents of |cocoa_view_|. 41 // Create a compositor to draw the contents of |cocoa_view_|.
41 compositor_.reset(new ui::Compositor( 42 compositor_.reset(new ui::Compositor(
42 cocoa_view_, content::GetContextFactory())); 43 cocoa_view_,
44 content::GetContextFactory(),
45 base::MessageLoopProxy::current()));
43 } 46 }
44 47
45 BrowserCompositorViewMacInternal::~BrowserCompositorViewMacInternal() { 48 BrowserCompositorViewMacInternal::~BrowserCompositorViewMacInternal() {
46 DCHECK(!client_); 49 DCHECK(!client_);
47 [cocoa_view_ resetClient]; 50 [cocoa_view_ resetClient];
48 } 51 }
49 52
50 void BrowserCompositorViewMacInternal::SetClient( 53 void BrowserCompositorViewMacInternal::SetClient(
51 BrowserCompositorViewMacClient* client) { 54 BrowserCompositorViewMacClient* client) {
52 // Disable the fade-in animation as the view is added. 55 // Disable the fade-in animation as the view is added.
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 - (void)gotSoftwareFrame:(cc::SoftwareFrameData*)frame_data 263 - (void)gotSoftwareFrame:(cc::SoftwareFrameData*)frame_data
261 withScaleFactor:(float)scale_factor 264 withScaleFactor:(float)scale_factor
262 withCanvas:(SkCanvas*)canvas { 265 withCanvas:(SkCanvas*)canvas {
263 if (!client_) 266 if (!client_)
264 return; 267 return;
265 client_->GotSoftwareFrame(frame_data, scale_factor, canvas); 268 client_->GotSoftwareFrame(frame_data, scale_factor, canvas);
266 } 269 }
267 270
268 @end // BrowserCompositorViewCocoa 271 @end // BrowserCompositorViewCocoa
269 272
OLDNEW
« no previous file with comments | « no previous file | content/browser/compositor/software_browser_compositor_output_surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698