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

Unified Diff: content/browser/compositor/software_output_device_ozone_unittest.cc

Issue 249413003: ozone: dri: Composite to intermediate surface & copy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: split drisurfaceadapter definitions Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/compositor/software_output_device_ozone_unittest.cc
diff --git a/content/browser/compositor/software_output_device_ozone_unittest.cc b/content/browser/compositor/software_output_device_ozone_unittest.cc
index 552430e8b183fc1d47bcb11c49fae487e8e0d071..fc9a6d3abdcc78a720b4c7061cc82508b75ff883 100644
--- a/content/browser/compositor/software_output_device_ozone_unittest.cc
+++ b/content/browser/compositor/software_output_device_ozone_unittest.cc
@@ -25,18 +25,14 @@ class MockSurfaceOzone : public gfx::SurfaceOzoneCanvas {
virtual ~MockSurfaceOzone() {}
// gfx::SurfaceOzoneCanvas overrides:
- virtual bool ResizeCanvas(const gfx::Size& size) OVERRIDE {
+ virtual void ResizeCanvas(const gfx::Size& size) OVERRIDE {
surface_ = skia::AdoptRef(SkSurface::NewRaster(
SkImageInfo::MakeN32Premul(size.width(), size.height())));
- return true;
}
virtual skia::RefPtr<SkCanvas> GetCanvas() OVERRIDE {
return skia::SharePtr(surface_->getCanvas());
}
- virtual bool PresentCanvas() OVERRIDE {
- NOTIMPLEMENTED();
- return true;
- }
+ virtual void PresentCanvas(const gfx::Rect& damage) OVERRIDE {}
virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() OVERRIDE {
return scoped_ptr<gfx::VSyncProvider>();
}
@@ -138,31 +134,6 @@ void SoftwareOutputDeviceOzonePixelTest::SetUp() {
SoftwareOutputDeviceOzoneTest::SetUp();
}
-TEST_F(SoftwareOutputDeviceOzoneTest, CheckClipAfterBeginPaint) {
- gfx::Rect damage(10, 10, 100, 100);
- SkCanvas* canvas = output_device_->BeginPaint(damage);
-
- SkIRect sk_bounds;
- canvas->getClipDeviceBounds(&sk_bounds);
-
- EXPECT_EQ(damage.ToString(), gfx::SkIRectToRect(sk_bounds).ToString());
-}
-
-TEST_F(SoftwareOutputDeviceOzoneTest, CheckClipAfterSecondBeginPaint) {
- gfx::Rect damage(10, 10, 100, 100);
- SkCanvas* canvas = output_device_->BeginPaint(damage);
-
- cc::SoftwareFrameData frame;
- output_device_->EndPaint(&frame);
-
- damage = gfx::Rect(100, 100, 100, 100);
- canvas = output_device_->BeginPaint(damage);
- SkIRect sk_bounds;
- canvas->getClipDeviceBounds(&sk_bounds);
-
- EXPECT_EQ(damage.ToString(), gfx::SkIRectToRect(sk_bounds).ToString());
-}
-
TEST_F(SoftwareOutputDeviceOzoneTest, CheckCorrectResizeBehavior) {
gfx::Rect damage(0, 0, 100, 100);
gfx::Size size(200, 100);
@@ -201,6 +172,7 @@ TEST_F(SoftwareOutputDeviceOzonePixelTest, CheckCopyToBitmap) {
// Draw a white rectangle.
gfx::Rect damage(area.width() / 2, area.height() / 2);
canvas = output_device_->BeginPaint(damage);
+ canvas->clipRect(gfx::RectToSkRect(damage), SkRegion::kReplace_Op);
canvas->drawColor(SK_ColorWHITE);
« no previous file with comments | « content/browser/compositor/software_output_device_ozone.cc ('k') | ui/gfx/ozone/impl/file_surface_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698