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

Side by Side Diff: cc/output/overlay_unittest.cc

Issue 640023004: cc: Make OutputSurface::SwapBuffers pure virtual (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@latinfo
Patch Set: rebase, comment, removed unused includes Created 6 years, 2 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 | « cc/output/output_surface_unittest.cc ('k') | cc/output/renderer_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 "cc/base/scoped_ptr_vector.h" 5 #include "cc/base/scoped_ptr_vector.h"
6 #include "cc/output/gl_renderer.h" 6 #include "cc/output/gl_renderer.h"
7 #include "cc/output/output_surface.h" 7 #include "cc/output/output_surface.h"
8 #include "cc/output/output_surface_client.h" 8 #include "cc/output/output_surface_client.h"
9 #include "cc/output/overlay_candidate_validator.h" 9 #include "cc/output/overlay_candidate_validator.h"
10 #include "cc/output/overlay_processor.h" 10 #include "cc/output/overlay_processor.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 size_t DefaultOverlayProcessor::GetStrategyCount() { 96 size_t DefaultOverlayProcessor::GetStrategyCount() {
97 return strategies_.size(); 97 return strategies_.size();
98 } 98 }
99 99
100 class OverlayOutputSurface : public OutputSurface { 100 class OverlayOutputSurface : public OutputSurface {
101 public: 101 public:
102 explicit OverlayOutputSurface(scoped_refptr<ContextProvider> context_provider) 102 explicit OverlayOutputSurface(scoped_refptr<ContextProvider> context_provider)
103 : OutputSurface(context_provider) {} 103 : OutputSurface(context_provider) {}
104 104
105 // OutputSurface implementation
106 virtual void SwapBuffers(CompositorFrame* frame) override;
107
105 void InitWithSingleOverlayValidator() { 108 void InitWithSingleOverlayValidator() {
106 overlay_candidate_validator_.reset(new SingleOverlayValidator); 109 overlay_candidate_validator_.reset(new SingleOverlayValidator);
107 } 110 }
108 }; 111 };
109 112
113 void OverlayOutputSurface::SwapBuffers(CompositorFrame* frame) {
114 client_->DidSwapBuffers();
115 client_->DidSwapBuffersComplete();
116 }
117
110 scoped_ptr<RenderPass> CreateRenderPass() { 118 scoped_ptr<RenderPass> CreateRenderPass() {
111 RenderPassId id(1, 0); 119 RenderPassId id(1, 0);
112 gfx::Rect output_rect(0, 0, 256, 256); 120 gfx::Rect output_rect(0, 0, 256, 256);
113 bool has_transparent_background = true; 121 bool has_transparent_background = true;
114 122
115 scoped_ptr<RenderPass> pass = RenderPass::Create(); 123 scoped_ptr<RenderPass> pass = RenderPass::Create();
116 pass->SetAll(id, 124 pass->SetAll(id,
117 output_rect, 125 output_rect,
118 output_rect, 126 output_rect,
119 gfx::Transform(), 127 gfx::Transform(),
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 renderer_->set_expect_overlays(false); 789 renderer_->set_expect_overlays(false);
782 renderer_->FinishDrawingFrame(&frame3); 790 renderer_->FinishDrawingFrame(&frame3);
783 EXPECT_TRUE(resource_provider_->InUseByConsumer(resource1)); 791 EXPECT_TRUE(resource_provider_->InUseByConsumer(resource1));
784 SwapBuffers(); 792 SwapBuffers();
785 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource1)); 793 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource1));
786 Mock::VerifyAndClearExpectations(&scheduler_); 794 Mock::VerifyAndClearExpectations(&scheduler_);
787 } 795 }
788 796
789 } // namespace 797 } // namespace
790 } // namespace cc 798 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/output_surface_unittest.cc ('k') | cc/output/renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698