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/quads/texture_draw_quad.h" | 7 #include "cc/quads/texture_draw_quad.h" |
8 #include "cc/surfaces/surface.h" | 8 #include "cc/surfaces/surface.h" |
9 #include "cc/surfaces/surface_manager.h" | 9 #include "cc/surfaces/surface_manager.h" |
10 #include "components/exo/buffer.h" | 10 #include "components/exo/buffer.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 surface->SetCrop(gfx::RectF(gfx::PointF(2.0, 2.0), gfx::SizeF(crop_size))); | 188 surface->SetCrop(gfx::RectF(gfx::PointF(2.0, 2.0), gfx::SizeF(crop_size))); |
189 surface->Commit(); | 189 surface->Commit(); |
190 EXPECT_EQ(crop_size.ToString(), | 190 EXPECT_EQ(crop_size.ToString(), |
191 surface->window()->bounds().size().ToString()); | 191 surface->window()->bounds().size().ToString()); |
192 EXPECT_EQ(crop_size.ToString(), surface->content_size().ToString()); | 192 EXPECT_EQ(crop_size.ToString(), surface->content_size().ToString()); |
193 } | 193 } |
194 | 194 |
195 const cc::CompositorFrame& GetFrameFromSurface(Surface* surface) { | 195 const cc::CompositorFrame& GetFrameFromSurface(Surface* surface) { |
196 cc::SurfaceId surface_id = surface->GetSurfaceId(); | 196 cc::SurfaceId surface_id = surface->GetSurfaceId(); |
197 cc::SurfaceManager* surface_manager = | 197 cc::SurfaceManager* surface_manager = |
198 aura::Env::GetInstance()->context_factory()->GetSurfaceManager(); | 198 aura::Env::GetInstance()->context_factory_private()->GetSurfaceManager(); |
199 const cc::CompositorFrame& frame = | 199 const cc::CompositorFrame& frame = |
200 surface_manager->GetSurfaceForId(surface_id)->GetEligibleFrame(); | 200 surface_manager->GetSurfaceForId(surface_id)->GetEligibleFrame(); |
201 return frame; | 201 return frame; |
202 } | 202 } |
203 | 203 |
204 TEST_F(SurfaceTest, SetBlendMode) { | 204 TEST_F(SurfaceTest, SetBlendMode) { |
205 gfx::Size buffer_size(1, 1); | 205 gfx::Size buffer_size(1, 1); |
206 std::unique_ptr<Buffer> buffer( | 206 std::unique_ptr<Buffer> buffer( |
207 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); | 207 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); |
208 std::unique_ptr<Surface> surface(new Surface); | 208 std::unique_ptr<Surface> surface(new Surface); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 254 |
255 TEST_F(SurfaceTest, Commit) { | 255 TEST_F(SurfaceTest, Commit) { |
256 std::unique_ptr<Surface> surface(new Surface); | 256 std::unique_ptr<Surface> surface(new Surface); |
257 | 257 |
258 // Calling commit without a buffer should succeed. | 258 // Calling commit without a buffer should succeed. |
259 surface->Commit(); | 259 surface->Commit(); |
260 } | 260 } |
261 | 261 |
262 } // namespace | 262 } // namespace |
263 } // namespace exo | 263 } // namespace exo |
OLD | NEW |