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

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

Issue 106633002: GBM Ozone implementation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « ui/ozone/platform/dri/dri_surface_factory_unittest.cc ('k') | ui/ozone/platform/dri/gbm.gypi » ('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 "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "third_party/skia/include/core/SkCanvas.h" 6 #include "third_party/skia/include/core/SkCanvas.h"
7 #include "third_party/skia/include/core/SkColor.h" 7 #include "third_party/skia/include/core/SkColor.h"
8 #include "third_party/skia/include/core/SkDevice.h" 8 #include "third_party/skia/include/core/SkDevice.h"
9 #include "ui/ozone/platform/dri/dri_buffer.h" 9 #include "ui/ozone/platform/dri/dri_buffer.h"
10 #include "ui/ozone/platform/dri/dri_surface.h" 10 #include "ui/ozone/platform/dri/dri_surface.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 surface_->set_initialize_expectation(false); 54 surface_->set_initialize_expectation(false);
55 EXPECT_FALSE(surface_->Initialize()); 55 EXPECT_FALSE(surface_->Initialize());
56 } 56 }
57 57
58 TEST_F(DriSurfaceTest, SuccessfulInitialization) { 58 TEST_F(DriSurfaceTest, SuccessfulInitialization) {
59 EXPECT_TRUE(surface_->Initialize()); 59 EXPECT_TRUE(surface_->Initialize());
60 } 60 }
61 61
62 TEST_F(DriSurfaceTest, CheckFBIDOnSwap) { 62 TEST_F(DriSurfaceTest, CheckFBIDOnSwap) {
63 EXPECT_TRUE(surface_->Initialize()); 63 EXPECT_TRUE(surface_->Initialize());
64 controller_->BindSurfaceToController(surface_.PassAs<ui::DriSurface>(), 64 controller_->BindSurfaceToController(surface_.PassAs<ui::ScanoutSurface>(),
65 kDefaultMode); 65 kDefaultMode);
66 66
67 // Check that the framebuffer ID is correct. 67 // Check that the framebuffer ID is correct.
68 EXPECT_EQ(2u, controller_->surface()->GetFramebufferId()); 68 EXPECT_EQ(2u, controller_->surface()->GetFramebufferId());
69 69
70 controller_->surface()->SwapBuffers(); 70 controller_->surface()->SwapBuffers();
71 71
72 EXPECT_EQ(1u, controller_->surface()->GetFramebufferId()); 72 EXPECT_EQ(1u, controller_->surface()->GetFramebufferId());
73 } 73 }
74 74
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 for (int j = 0; j < canvas->getDeviceSize().width(); ++j) { 109 for (int j = 0; j < canvas->getDeviceSize().width(); ++j) {
110 if (i < clip.height() && j < clip.width()) 110 if (i < clip.height() && j < clip.width())
111 EXPECT_EQ(SK_ColorWHITE, 111 EXPECT_EQ(SK_ColorWHITE,
112 canvas->getDevice()->accessBitmap(false).getColor(j, i)); 112 canvas->getDevice()->accessBitmap(false).getColor(j, i));
113 else 113 else
114 EXPECT_EQ(SK_ColorBLACK, 114 EXPECT_EQ(SK_ColorBLACK,
115 canvas->getDevice()->accessBitmap(false).getColor(j, i)); 115 canvas->getDevice()->accessBitmap(false).getColor(j, i));
116 } 116 }
117 } 117 }
118 } 118 }
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/dri_surface_factory_unittest.cc ('k') | ui/ozone/platform/dri/gbm.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698