| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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( |
| 203 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); | 203 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); |
| 204 std::unique_ptr<Surface> surface(new Surface); | 204 std::unique_ptr<Surface> surface(new Surface); |
| 205 | 205 |
| 206 surface->Attach(buffer.get()); | 206 surface->Attach(buffer.get()); |
| 207 surface->SetBlendMode(SkXfermode::kSrc_Mode); | 207 surface->SetBlendMode(SkBlendMode::kSrc); |
| 208 surface->Commit(); | 208 surface->Commit(); |
| 209 | 209 |
| 210 const cc::DelegatedFrameData* frame_data = GetFrameFromSurface(surface.get()); | 210 const cc::DelegatedFrameData* frame_data = GetFrameFromSurface(surface.get()); |
| 211 ASSERT_EQ(1u, frame_data->render_pass_list.size()); | 211 ASSERT_EQ(1u, frame_data->render_pass_list.size()); |
| 212 ASSERT_EQ(1u, frame_data->render_pass_list.back()->quad_list.size()); | 212 ASSERT_EQ(1u, frame_data->render_pass_list.back()->quad_list.size()); |
| 213 EXPECT_FALSE(frame_data->render_pass_list.back() | 213 EXPECT_FALSE(frame_data->render_pass_list.back() |
| 214 ->quad_list.back() | 214 ->quad_list.back() |
| 215 ->ShouldDrawWithBlending()); | 215 ->ShouldDrawWithBlending()); |
| 216 } | 216 } |
| 217 | 217 |
| (...skipping 31 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 |