| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "third_party/skia/include/core/SkCanvas.h" | 10 #include "third_party/skia/include/core/SkCanvas.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 {0, 6, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, {'\0'}}; | 28 {0, 6, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, {'\0'}}; |
| 29 | 29 |
| 30 const gfx::AcceleratedWidget kDefaultWidgetHandle = 1; | 30 const gfx::AcceleratedWidget kDefaultWidgetHandle = 1; |
| 31 const uint32_t kDefaultCrtc = 1; | 31 const uint32_t kDefaultCrtc = 1; |
| 32 const uint32_t kDefaultConnector = 2; | 32 const uint32_t kDefaultConnector = 2; |
| 33 const int kDefaultCursorSize = 64; | 33 const int kDefaultCursorSize = 64; |
| 34 | 34 |
| 35 std::vector<skia::RefPtr<SkSurface>> GetCursorBuffers( | 35 std::vector<skia::RefPtr<SkSurface>> GetCursorBuffers( |
| 36 const scoped_refptr<ui::MockDrmDevice> drm) { | 36 const scoped_refptr<ui::MockDrmDevice> drm) { |
| 37 std::vector<skia::RefPtr<SkSurface>> cursor_buffers; | 37 std::vector<skia::RefPtr<SkSurface>> cursor_buffers; |
| 38 for (const skia::RefPtr<SkSurface>& cursor_buffer : drm->buffers()) { | 38 for (const auto& cursor_buffer : drm->buffers()) { |
| 39 if (cursor_buffer->width() == kDefaultCursorSize && | 39 if (cursor_buffer->width() == kDefaultCursorSize && |
| 40 cursor_buffer->height() == kDefaultCursorSize) { | 40 cursor_buffer->height() == kDefaultCursorSize) { |
| 41 cursor_buffers.push_back(cursor_buffer); | 41 cursor_buffers.push_back(cursor_buffer); |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 return cursor_buffers; | 45 return cursor_buffers; |
| 46 } | 46 } |
| 47 | 47 |
| 48 SkBitmap AllocateBitmap(const gfx::Size& size) { | 48 SkBitmap AllocateBitmap(const gfx::Size& size) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // Move window to the display on the new device. | 142 // Move window to the display on the new device. |
| 143 screen_manager_->GetWindow(kDefaultWidgetHandle) | 143 screen_manager_->GetWindow(kDefaultWidgetHandle) |
| 144 ->OnBoundsChanged(gfx::Rect(0, kDefaultMode.vdisplay, | 144 ->OnBoundsChanged(gfx::Rect(0, kDefaultMode.vdisplay, |
| 145 kDefaultMode.hdisplay, | 145 kDefaultMode.hdisplay, |
| 146 kDefaultMode.vdisplay)); | 146 kDefaultMode.vdisplay)); |
| 147 | 147 |
| 148 EXPECT_EQ(2u, GetCursorBuffers(drm).size()); | 148 EXPECT_EQ(2u, GetCursorBuffers(drm).size()); |
| 149 // Make sure the cursor is showing on the new display. | 149 // Make sure the cursor is showing on the new display. |
| 150 EXPECT_NE(0u, drm->get_cursor_handle_for_crtc(kDefaultCrtc)); | 150 EXPECT_NE(0u, drm->get_cursor_handle_for_crtc(kDefaultCrtc)); |
| 151 } | 151 } |
| OLD | NEW |