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

Side by Side Diff: cc/surfaces/surface_display_output_surface.cc

Issue 886633007: Always force swap for SurfaceDisplayOutputSurface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | cc/trees/layer_tree_host_impl.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 "cc/surfaces/surface_display_output_surface.h" 5 #include "cc/surfaces/surface_display_output_surface.h"
6 6
7 #include "cc/output/compositor_frame.h" 7 #include "cc/output/compositor_frame.h"
8 #include "cc/output/compositor_frame_ack.h" 8 #include "cc/output/compositor_frame_ack.h"
9 #include "cc/surfaces/display.h" 9 #include "cc/surfaces/display.h"
10 #include "cc/surfaces/onscreen_display_client.h" 10 #include "cc/surfaces/onscreen_display_client.h"
11 #include "cc/surfaces/surface.h" 11 #include "cc/surfaces/surface.h"
12 #include "cc/surfaces/surface_manager.h" 12 #include "cc/surfaces/surface_manager.h"
13 13
14 namespace cc { 14 namespace cc {
15 15
16 SurfaceDisplayOutputSurface::SurfaceDisplayOutputSurface( 16 SurfaceDisplayOutputSurface::SurfaceDisplayOutputSurface(
17 SurfaceManager* surface_manager, 17 SurfaceManager* surface_manager,
18 SurfaceIdAllocator* allocator, 18 SurfaceIdAllocator* allocator,
19 const scoped_refptr<ContextProvider>& context_provider) 19 const scoped_refptr<ContextProvider>& context_provider)
20 : OutputSurface(context_provider, nullptr), 20 : OutputSurface(context_provider, nullptr),
21 display_client_(NULL), 21 display_client_(NULL),
22 surface_manager_(surface_manager), 22 surface_manager_(surface_manager),
23 factory_(surface_manager, this), 23 factory_(surface_manager, this),
24 allocator_(allocator) { 24 allocator_(allocator) {
25 capabilities_.delegated_rendering = true; 25 capabilities_.delegated_rendering = true;
26 capabilities_.max_frames_pending = 1; 26 capabilities_.max_frames_pending = 1;
27 capabilities_.can_force_reclaim_resources = true; 27 capabilities_.can_force_reclaim_resources = true;
28 // Frame always needs to be swapped because forced resource reclaiming
29 // destroys the Display's copy.
30 capabilities_.draw_and_swap_full_viewport_every_frame = true;
28 } 31 }
29 32
30 SurfaceDisplayOutputSurface::~SurfaceDisplayOutputSurface() { 33 SurfaceDisplayOutputSurface::~SurfaceDisplayOutputSurface() {
31 client_ = NULL; 34 client_ = NULL;
32 if (!surface_id_.is_null()) { 35 if (!surface_id_.is_null()) {
33 factory_.Destroy(surface_id_); 36 factory_.Destroy(surface_id_);
34 } 37 }
35 } 38 }
36 39
37 void SurfaceDisplayOutputSurface::ReceivedVSyncParameters( 40 void SurfaceDisplayOutputSurface::ReceivedVSyncParameters(
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 if (client_) 92 if (client_)
90 client_->ReclaimResources(&ack); 93 client_->ReclaimResources(&ack);
91 } 94 }
92 95
93 void SurfaceDisplayOutputSurface::SwapBuffersComplete(SurfaceDrawStatus drawn) { 96 void SurfaceDisplayOutputSurface::SwapBuffersComplete(SurfaceDrawStatus drawn) {
94 if (client_ && !display_client_->output_surface_lost()) 97 if (client_ && !display_client_->output_surface_lost())
95 client_->DidSwapBuffersComplete(); 98 client_->DidSwapBuffersComplete();
96 } 99 }
97 100
98 } // namespace cc 101 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698