OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "cc/output/compositor_frame.h" | 6 #include "cc/output/compositor_frame.h" |
7 #include "cc/output/delegated_frame_data.h" | 7 #include "cc/output/delegated_frame_data.h" |
8 #include "cc/quads/texture_draw_quad.h" | 8 #include "cc/quads/texture_draw_quad.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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 surface->Attach(buffer.get()); | 182 surface->Attach(buffer.get()); |
183 gfx::Size crop_size(12, 12); | 183 gfx::Size crop_size(12, 12); |
184 surface->SetCrop(gfx::RectF(gfx::PointF(2.0, 2.0), gfx::SizeF(crop_size))); | 184 surface->SetCrop(gfx::RectF(gfx::PointF(2.0, 2.0), gfx::SizeF(crop_size))); |
185 surface->Commit(); | 185 surface->Commit(); |
186 EXPECT_EQ(crop_size.ToString(), | 186 EXPECT_EQ(crop_size.ToString(), |
187 surface->window()->bounds().size().ToString()); | 187 surface->window()->bounds().size().ToString()); |
188 EXPECT_EQ(crop_size.ToString(), surface->content_size().ToString()); | 188 EXPECT_EQ(crop_size.ToString(), surface->content_size().ToString()); |
189 } | 189 } |
190 | 190 |
191 const cc::DelegatedFrameData* GetFrameFromSurface(Surface* surface) { | 191 const cc::DelegatedFrameData* GetFrameFromSurface(Surface* surface) { |
192 cc::SurfaceId surface_id = surface->surface_id(); | 192 cc::SurfaceId surface_id = surface->GetSurfaceId(); |
193 cc::SurfaceManager* surface_manager = | 193 cc::SurfaceManager* surface_manager = |
194 aura::Env::GetInstance()->context_factory()->GetSurfaceManager(); | 194 aura::Env::GetInstance()->context_factory()->GetSurfaceManager(); |
195 const cc::CompositorFrame& frame = | 195 const cc::CompositorFrame& frame = |
196 surface_manager->GetSurfaceForId(surface_id)->GetEligibleFrame(); | 196 surface_manager->GetSurfaceForId(surface_id)->GetEligibleFrame(); |
197 return frame.delegated_frame_data.get(); | 197 return frame.delegated_frame_data.get(); |
198 } | 198 } |
199 | 199 |
200 TEST_F(SurfaceTest, SetBlendMode) { | 200 TEST_F(SurfaceTest, SetBlendMode) { |
201 gfx::Size buffer_size(1, 1); | 201 gfx::Size buffer_size(1, 1); |
202 std::unique_ptr<Buffer> buffer( | 202 std::unique_ptr<Buffer> buffer( |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 | 249 |
250 TEST_F(SurfaceTest, Commit) { | 250 TEST_F(SurfaceTest, Commit) { |
251 std::unique_ptr<Surface> surface(new Surface); | 251 std::unique_ptr<Surface> surface(new Surface); |
252 | 252 |
253 // Calling commit without a buffer should succeed. | 253 // Calling commit without a buffer should succeed. |
254 surface->Commit(); | 254 surface->Commit(); |
255 } | 255 } |
256 | 256 |
257 } // namespace | 257 } // namespace |
258 } // namespace exo | 258 } // namespace exo |
OLD | NEW |