| 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 "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/compositor/software_output_device_ozone.h" | 8 #include "content/browser/compositor/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/SkSurface.h" | 10 #include "third_party/skia/include/core/SkSurface.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 skia::RefPtr<SkSurface> surface_; | 41 skia::RefPtr<SkSurface> surface_; |
| 42 | 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(MockSurfaceOzone); | 43 DISALLOW_COPY_AND_ASSIGN(MockSurfaceOzone); |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 class MockSurfaceFactoryOzone : public ui::SurfaceFactoryOzone { | 46 class MockSurfaceFactoryOzone : public ui::SurfaceFactoryOzone { |
| 47 public: | 47 public: |
| 48 MockSurfaceFactoryOzone() {} | 48 MockSurfaceFactoryOzone() {} |
| 49 virtual ~MockSurfaceFactoryOzone() {} | 49 virtual ~MockSurfaceFactoryOzone() {} |
| 50 | 50 |
| 51 virtual HardwareState InitializeHardware() OVERRIDE { | |
| 52 return SurfaceFactoryOzone::INITIALIZED; | |
| 53 } | |
| 54 | |
| 55 virtual void ShutdownHardware() OVERRIDE {} | |
| 56 virtual bool LoadEGLGLES2Bindings( | 51 virtual bool LoadEGLGLES2Bindings( |
| 57 AddGLLibraryCallback add_gl_library, | 52 AddGLLibraryCallback add_gl_library, |
| 58 SetGLGetProcAddressProcCallback set_gl_get_proc_address) OVERRIDE { | 53 SetGLGetProcAddressProcCallback set_gl_get_proc_address) OVERRIDE { |
| 59 return false; | 54 return false; |
| 60 } | 55 } |
| 61 virtual scoped_ptr<ui::SurfaceOzoneCanvas> CreateCanvasForWidget( | 56 virtual scoped_ptr<ui::SurfaceOzoneCanvas> CreateCanvasForWidget( |
| 62 gfx::AcceleratedWidget widget) OVERRIDE { | 57 gfx::AcceleratedWidget widget) OVERRIDE { |
| 63 return make_scoped_ptr<ui::SurfaceOzoneCanvas>(new MockSurfaceOzone()); | 58 return make_scoped_ptr<ui::SurfaceOzoneCanvas>(new MockSurfaceOzone()); |
| 64 } | 59 } |
| 65 | 60 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 const SkPMColor black = SkPreMultiplyColor(SK_ColorBLACK); | 180 const SkPMColor black = SkPreMultiplyColor(SK_ColorBLACK); |
| 186 for (int i = 0; i < area.height(); ++i) { | 181 for (int i = 0; i < area.height(); ++i) { |
| 187 for (int j = 0; j < area.width(); ++j) { | 182 for (int j = 0; j < area.width(); ++j) { |
| 188 if (j < damage.width() && i < damage.height()) | 183 if (j < damage.width() && i < damage.height()) |
| 189 EXPECT_EQ(white, pixels[i * area.width() + j]); | 184 EXPECT_EQ(white, pixels[i * area.width() + j]); |
| 190 else | 185 else |
| 191 EXPECT_EQ(black, pixels[i * area.width() + j]); | 186 EXPECT_EQ(black, pixels[i * area.width() + j]); |
| 192 } | 187 } |
| 193 } | 188 } |
| 194 } | 189 } |
| OLD | NEW |