| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "ContentLayerChromium.h" | 7 #include "ContentLayerChromium.h" |
| 8 | 8 |
| 9 #include "BitmapCanvasLayerTextureUpdater.h" | 9 #include "BitmapCanvasLayerTextureUpdater.h" |
| 10 #include "CCGeometryTestUtils.h" | 10 #include "CCGeometryTestUtils.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 TEST(ContentLayerChromiumTest, ContentLayerPainterWithDeviceScale) | 39 TEST(ContentLayerChromiumTest, ContentLayerPainterWithDeviceScale) |
| 40 { | 40 { |
| 41 float contentsScale = 2; | 41 float contentsScale = 2; |
| 42 IntRect contentRect(10, 10, 100, 100); | 42 IntRect contentRect(10, 10, 100, 100); |
| 43 IntRect opaqueRectInLayerSpace(5, 5, 20, 20); | 43 IntRect opaqueRectInLayerSpace(5, 5, 20, 20); |
| 44 IntRect opaqueRectInContentSpace = opaqueRectInLayerSpace; | 44 IntRect opaqueRectInContentSpace = opaqueRectInLayerSpace; |
| 45 opaqueRectInContentSpace.scale(contentsScale); | 45 opaqueRectInContentSpace.scale(contentsScale); |
| 46 MockContentLayerChromiumClient client(opaqueRectInLayerSpace); | 46 MockContentLayerChromiumClient client(opaqueRectInLayerSpace); |
| 47 RefPtr<BitmapCanvasLayerTextureUpdater> updater = BitmapCanvasLayerTextureUp
dater::create(ContentLayerPainter::create(&client).PassAs<LayerPainterChromium>(
)); | 47 scoped_refptr<BitmapCanvasLayerTextureUpdater> updater = BitmapCanvasLayerTe
xtureUpdater::create(ContentLayerPainter::create(&client).PassAs<LayerPainterChr
omium>()); |
| 48 | 48 |
| 49 IntRect resultingOpaqueRect; | 49 IntRect resultingOpaqueRect; |
| 50 CCRenderingStats stats; | 50 CCRenderingStats stats; |
| 51 updater->prepareToUpdate(contentRect, IntSize(256, 256), contentsScale, cont
entsScale, resultingOpaqueRect, stats); | 51 updater->prepareToUpdate(contentRect, IntSize(256, 256), contentsScale, cont
entsScale, resultingOpaqueRect, stats); |
| 52 | 52 |
| 53 EXPECT_RECT_EQ(opaqueRectInContentSpace, resultingOpaqueRect); | 53 EXPECT_RECT_EQ(opaqueRectInContentSpace, resultingOpaqueRect); |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // namespace | 56 } // namespace |
| OLD | NEW |