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

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

Issue 959953002: [Ozone-Dri] Do not call AddFramebuffer with cursor buffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: renamed param Created 5 years, 9 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
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 14 matching lines...) Expand all
25 const size_t kPlanesPerCrtc = 1; 25 const size_t kPlanesPerCrtc = 1;
26 26
27 class MockDriWindowDelegate : public ui::DriWindowDelegate { 27 class MockDriWindowDelegate : public ui::DriWindowDelegate {
28 public: 28 public:
29 MockDriWindowDelegate(ui::DriWrapper* drm) { 29 MockDriWindowDelegate(ui::DriWrapper* drm) {
30 controller_.reset(new ui::HardwareDisplayController(make_scoped_ptr( 30 controller_.reset(new ui::HardwareDisplayController(make_scoped_ptr(
31 new ui::CrtcController(drm, kDefaultCrtc, kDefaultConnector)))); 31 new ui::CrtcController(drm, kDefaultCrtc, kDefaultConnector))));
32 scoped_refptr<ui::DriBuffer> buffer(new ui::DriBuffer(drm)); 32 scoped_refptr<ui::DriBuffer> buffer(new ui::DriBuffer(drm));
33 SkImageInfo info = SkImageInfo::MakeN32Premul(kDefaultMode.hdisplay, 33 SkImageInfo info = SkImageInfo::MakeN32Premul(kDefaultMode.hdisplay,
34 kDefaultMode.vdisplay); 34 kDefaultMode.vdisplay);
35 EXPECT_TRUE(buffer->Initialize(info)); 35 EXPECT_TRUE(buffer->Initialize(info, true));
36 EXPECT_TRUE(controller_->Modeset(ui::OverlayPlane(buffer), kDefaultMode)); 36 EXPECT_TRUE(controller_->Modeset(ui::OverlayPlane(buffer), kDefaultMode));
37 } 37 }
38 ~MockDriWindowDelegate() override {} 38 ~MockDriWindowDelegate() override {}
39 39
40 // DriWindowDelegate: 40 // DriWindowDelegate:
41 void Initialize() override {} 41 void Initialize() override {}
42 void Shutdown() override {} 42 void Shutdown() override {}
43 gfx::AcceleratedWidget GetAcceleratedWidget() override { return 1; } 43 gfx::AcceleratedWidget GetAcceleratedWidget() override { return 1; }
44 ui::HardwareDisplayController* GetController() override { 44 ui::HardwareDisplayController* GetController() override {
45 return controller_.get(); 45 return controller_.get();
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 // Make sure the updates are correctly propagated to the native surface. 126 // Make sure the updates are correctly propagated to the native surface.
127 for (int i = 0; i < image.height(); ++i) { 127 for (int i = 0; i < image.height(); ++i) {
128 for (int j = 0; j < image.width(); ++j) { 128 for (int j = 0; j < image.width(); ++j) {
129 if (j < kDefaultMode.hdisplay / 2 && i < kDefaultMode.vdisplay / 2) 129 if (j < kDefaultMode.hdisplay / 2 && i < kDefaultMode.vdisplay / 2)
130 EXPECT_EQ(SK_ColorWHITE, image.getColor(j, i)); 130 EXPECT_EQ(SK_ColorWHITE, image.getColor(j, i));
131 else 131 else
132 EXPECT_EQ(SK_ColorBLACK, image.getColor(j, i)); 132 EXPECT_EQ(SK_ColorBLACK, image.getColor(j, i));
133 } 133 }
134 } 134 }
135 } 135 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698