OLD | NEW |
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 mailbox, release_callback.Pass()); | 145 mailbox, release_callback.Pass()); |
146 } | 146 } |
147 | 147 |
148 TextureDrawQuad* CreateCandidateQuadAt(ResourceProvider* resource_provider, | 148 TextureDrawQuad* CreateCandidateQuadAt(ResourceProvider* resource_provider, |
149 const SharedQuadState* shared_quad_state, | 149 const SharedQuadState* shared_quad_state, |
150 RenderPass* render_pass, | 150 RenderPass* render_pass, |
151 const gfx::Rect& rect) { | 151 const gfx::Rect& rect) { |
152 ResourceProvider::ResourceId resource_id = CreateResource(resource_provider); | 152 ResourceProvider::ResourceId resource_id = CreateResource(resource_provider); |
153 bool premultiplied_alpha = false; | 153 bool premultiplied_alpha = false; |
154 bool flipped = false; | 154 bool flipped = false; |
| 155 bool nearest_neighbor = false; |
155 float vertex_opacity[4] = {1.0f, 1.0f, 1.0f, 1.0f}; | 156 float vertex_opacity[4] = {1.0f, 1.0f, 1.0f, 1.0f}; |
156 | 157 |
157 TextureDrawQuad* overlay_quad = | 158 TextureDrawQuad* overlay_quad = |
158 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); | 159 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); |
159 overlay_quad->SetNew(shared_quad_state, | 160 overlay_quad->SetNew(shared_quad_state, |
160 rect, | 161 rect, |
161 rect, | 162 rect, |
162 rect, | 163 rect, |
163 resource_id, | 164 resource_id, |
164 premultiplied_alpha, | 165 premultiplied_alpha, |
165 kUVTopLeft, | 166 kUVTopLeft, |
166 kUVBottomRight, | 167 kUVBottomRight, |
167 SK_ColorTRANSPARENT, | 168 SK_ColorTRANSPARENT, |
168 vertex_opacity, | 169 vertex_opacity, |
169 flipped); | 170 flipped, |
| 171 nearest_neighbor); |
170 | 172 |
171 return overlay_quad; | 173 return overlay_quad; |
172 } | 174 } |
173 | 175 |
174 TextureDrawQuad* CreateFullscreenCandidateQuad( | 176 TextureDrawQuad* CreateFullscreenCandidateQuad( |
175 ResourceProvider* resource_provider, | 177 ResourceProvider* resource_provider, |
176 const SharedQuadState* shared_quad_state, | 178 const SharedQuadState* shared_quad_state, |
177 RenderPass* render_pass) { | 179 RenderPass* render_pass) { |
178 return CreateCandidateQuadAt( | 180 return CreateCandidateQuadAt( |
179 resource_provider, shared_quad_state, render_pass, kOverlayRect); | 181 resource_provider, shared_quad_state, render_pass, kOverlayRect); |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 renderer_->BeginDrawingFrame(&frame3); | 807 renderer_->BeginDrawingFrame(&frame3); |
806 renderer_->FinishDrawingFrame(&frame3); | 808 renderer_->FinishDrawingFrame(&frame3); |
807 EXPECT_TRUE(resource_provider_->InUseByConsumer(resource1)); | 809 EXPECT_TRUE(resource_provider_->InUseByConsumer(resource1)); |
808 SwapBuffers(); | 810 SwapBuffers(); |
809 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource1)); | 811 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource1)); |
810 Mock::VerifyAndClearExpectations(&scheduler_); | 812 Mock::VerifyAndClearExpectations(&scheduler_); |
811 } | 813 } |
812 | 814 |
813 } // namespace | 815 } // namespace |
814 } // namespace cc | 816 } // namespace cc |
OLD | NEW |