Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(436)

Side by Side Diff: ui/ozone/platform/dri/dri_surface_unittest.cc

Issue 821023003: [Ozone-DRI] Listen for swap events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@async-swap
Patch Set: Added comment Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/ozone/platform/dri/dri_surface.cc ('k') | ui/ozone/platform/dri/dri_wrapper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 #include "third_party/skia/include/core/SkCanvas.h" 7 #include "third_party/skia/include/core/SkCanvas.h"
8 #include "third_party/skia/include/core/SkColor.h" 8 #include "third_party/skia/include/core/SkColor.h"
9 #include "third_party/skia/include/core/SkDevice.h" 9 #include "third_party/skia/include/core/SkDevice.h"
10 #include "ui/ozone/platform/dri/crtc_controller.h" 10 #include "ui/ozone/platform/dri/crtc_controller.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 scoped_ptr<ui::DriSurface> surface_; 72 scoped_ptr<ui::DriSurface> surface_;
73 73
74 private: 74 private:
75 DISALLOW_COPY_AND_ASSIGN(DriSurfaceTest); 75 DISALLOW_COPY_AND_ASSIGN(DriSurfaceTest);
76 }; 76 };
77 77
78 void DriSurfaceTest::SetUp() { 78 void DriSurfaceTest::SetUp() {
79 message_loop_.reset(new base::MessageLoopForUI); 79 message_loop_.reset(new base::MessageLoopForUI);
80 std::vector<uint32_t> crtcs; 80 std::vector<uint32_t> crtcs;
81 crtcs.push_back(kDefaultCrtc); 81 crtcs.push_back(kDefaultCrtc);
82 drm_.reset(new ui::MockDriWrapper(3, crtcs, kPlanesPerCrtc)); 82 drm_.reset(new ui::MockDriWrapper(3, true, crtcs, kPlanesPerCrtc));
83 window_delegate_.reset(new MockDriWindowDelegate(drm_.get())); 83 window_delegate_.reset(new MockDriWindowDelegate(drm_.get()));
84 surface_.reset(new ui::DriSurface(window_delegate_.get(), drm_.get())); 84 surface_.reset(new ui::DriSurface(window_delegate_.get(), drm_.get()));
85 surface_->ResizeCanvas(gfx::Size(kDefaultMode.hdisplay, 85 surface_->ResizeCanvas(gfx::Size(kDefaultMode.hdisplay,
86 kDefaultMode.vdisplay)); 86 kDefaultMode.vdisplay));
87 } 87 }
88 88
89 void DriSurfaceTest::TearDown() { 89 void DriSurfaceTest::TearDown() {
90 surface_.reset(); 90 surface_.reset();
91 window_delegate_.reset(); 91 window_delegate_.reset();
92 drm_.reset(); 92 drm_.reset();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // Make sure the updates are correctly propagated to the native surface. 124 // Make sure the updates are correctly propagated to the native surface.
125 for (int i = 0; i < image.height(); ++i) { 125 for (int i = 0; i < image.height(); ++i) {
126 for (int j = 0; j < image.width(); ++j) { 126 for (int j = 0; j < image.width(); ++j) {
127 if (j < kDefaultMode.hdisplay / 2 && i < kDefaultMode.vdisplay / 2) 127 if (j < kDefaultMode.hdisplay / 2 && i < kDefaultMode.vdisplay / 2)
128 EXPECT_EQ(SK_ColorWHITE, image.getColor(j, i)); 128 EXPECT_EQ(SK_ColorWHITE, image.getColor(j, i));
129 else 129 else
130 EXPECT_EQ(SK_ColorBLACK, image.getColor(j, i)); 130 EXPECT_EQ(SK_ColorBLACK, image.getColor(j, i));
131 } 131 }
132 } 132 }
133 } 133 }
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/dri_surface.cc ('k') | ui/ozone/platform/dri/dri_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698