OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "cc/output/software_frame_data.h" | 7 #include "cc/output/software_frame_data.h" |
8 #include "content/browser/aura/software_output_device_ozone.h" | 8 #include "content/browser/aura/software_output_device_ozone.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "third_party/skia/include/core/SkBitmapDevice.h" | 10 #include "third_party/skia/include/core/SkBitmapDevice.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 private: | 74 private: |
75 scoped_ptr<ui::Compositor> compositor_; | 75 scoped_ptr<ui::Compositor> compositor_; |
76 scoped_ptr<base::MessageLoop> message_loop_; | 76 scoped_ptr<base::MessageLoop> message_loop_; |
77 scoped_ptr<gfx::SurfaceFactoryOzone> surface_factory_; | 77 scoped_ptr<gfx::SurfaceFactoryOzone> surface_factory_; |
78 | 78 |
79 DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceOzoneTest); | 79 DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceOzoneTest); |
80 }; | 80 }; |
81 | 81 |
82 SoftwareOutputDeviceOzoneTest::SoftwareOutputDeviceOzoneTest() { | 82 SoftwareOutputDeviceOzoneTest::SoftwareOutputDeviceOzoneTest() { |
83 CHECK(gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL)); | 83 CHECK(gfx::InitializeStaticGLBindings(gfx::kGLImplementationOSMesaGL)); |
84 message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); | 84 message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); |
85 } | 85 } |
86 | 86 |
87 SoftwareOutputDeviceOzoneTest::~SoftwareOutputDeviceOzoneTest() { | 87 SoftwareOutputDeviceOzoneTest::~SoftwareOutputDeviceOzoneTest() { |
88 } | 88 } |
89 | 89 |
90 void SoftwareOutputDeviceOzoneTest::SetUp() { | 90 void SoftwareOutputDeviceOzoneTest::SetUp() { |
91 ui::InitializeContextFactoryForTests(false); | 91 ui::InitializeContextFactoryForTests(false); |
92 ui::Compositor::Initialize(); | 92 ui::Compositor::Initialize(); |
93 | 93 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 // painted. | 186 // painted. |
187 for (int i = 0; i < area.height(); ++i) { | 187 for (int i = 0; i < area.height(); ++i) { |
188 for (int j = 0; j < area.width(); ++j) { | 188 for (int j = 0; j < area.width(); ++j) { |
189 if (j < damage.width() && i < damage.height()) | 189 if (j < damage.width() && i < damage.height()) |
190 EXPECT_EQ(SK_ColorWHITE, bitmap.getColor(j, i)); | 190 EXPECT_EQ(SK_ColorWHITE, bitmap.getColor(j, i)); |
191 else | 191 else |
192 EXPECT_EQ(SK_ColorBLACK, bitmap.getColor(j, i)); | 192 EXPECT_EQ(SK_ColorBLACK, bitmap.getColor(j, i)); |
193 } | 193 } |
194 } | 194 } |
195 } | 195 } |
OLD | NEW |