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

Side by Side Diff: content/browser/compositor/surface_display_output_surface.cc

Issue 331533002: Use a struct for cc::Surface ids for more type safety (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add is_null and explicit ctor 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 | Annotate | Revision Log
« no previous file with comments | « cc/surfaces/surface_unittest.cc ('k') | content/common/cc_messages.h » ('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/surface_display_output_surface.h" 5 #include "content/browser/compositor/surface_display_output_surface.h"
6 6
7 #include "cc/output/compositor_frame.h" 7 #include "cc/output/compositor_frame.h"
8 #include "cc/surfaces/display.h" 8 #include "cc/surfaces/display.h"
9 #include "cc/surfaces/surface.h" 9 #include "cc/surfaces/surface.h"
10 #include "cc/surfaces/surface_manager.h" 10 #include "cc/surfaces/surface_manager.h"
(...skipping 12 matching lines...) Expand all
23 capabilities_.max_frames_pending = 1; 23 capabilities_.max_frames_pending = 1;
24 } 24 }
25 25
26 SurfaceDisplayOutputSurface::~SurfaceDisplayOutputSurface() { 26 SurfaceDisplayOutputSurface::~SurfaceDisplayOutputSurface() {
27 } 27 }
28 28
29 void SurfaceDisplayOutputSurface::SwapBuffers(cc::CompositorFrame* frame) { 29 void SurfaceDisplayOutputSurface::SwapBuffers(cc::CompositorFrame* frame) {
30 gfx::Size frame_size = 30 gfx::Size frame_size =
31 frame->delegated_frame_data->render_pass_list.back()->output_rect.size(); 31 frame->delegated_frame_data->render_pass_list.back()->output_rect.size();
32 display_->Resize(frame_size); 32 display_->Resize(frame_size);
33 int surface_id = display_->CurrentSurfaceID(); 33 cc::SurfaceId surface_id = display_->CurrentSurfaceId();
34 cc::Surface* surface = surface_manager_->GetSurfaceForID(surface_id); 34 cc::Surface* surface = surface_manager_->GetSurfaceForId(surface_id);
35 if (!surface) 35 if (!surface)
36 return; 36 return;
37 37
38 scoped_ptr<cc::CompositorFrame> frame_copy(new cc::CompositorFrame()); 38 scoped_ptr<cc::CompositorFrame> frame_copy(new cc::CompositorFrame());
39 frame->AssignTo(frame_copy.get()); 39 frame->AssignTo(frame_copy.get());
40 surface->QueueFrame(frame_copy.Pass()); 40 surface->QueueFrame(frame_copy.Pass());
41 41
42 if (!display_->Draw()) 42 if (!display_->Draw())
43 return; 43 return;
44 44
45 client_->DidSwapBuffers(); 45 client_->DidSwapBuffers();
46 client_->DidSwapBuffersComplete(); 46 client_->DidSwapBuffersComplete();
47 } 47 }
48 48
49 } // namespace content 49 } // namespace content
OLDNEW
« no previous file with comments | « cc/surfaces/surface_unittest.cc ('k') | content/common/cc_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698