| OLD | NEW | 
|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "web/PageOverlay.h" | 6 #include "web/PageOverlay.h" | 
| 7 | 7 | 
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" | 
| 9 #include "core/layout/LayoutView.h" | 9 #include "core/layout/LayoutView.h" | 
| 10 #include "platform/graphics/Color.h" | 10 #include "platform/graphics/Color.h" | 
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 148     EXPECT_CALL(canvas, onDrawRect(SkRect::MakeWH(viewportWidth, viewportHeight)
     , Property(&SkPaint::getColor, SK_ColorYELLOW))); | 148     EXPECT_CALL(canvas, onDrawRect(SkRect::MakeWH(viewportWidth, viewportHeight)
     , Property(&SkPaint::getColor, SK_ColorYELLOW))); | 
| 149 | 149 | 
| 150     GraphicsLayer* graphicsLayer = pageOverlay->graphicsLayer(); | 150     GraphicsLayer* graphicsLayer = pageOverlay->graphicsLayer(); | 
| 151     WebRect rect(0, 0, viewportWidth, viewportHeight); | 151     WebRect rect(0, 0, viewportWidth, viewportHeight); | 
| 152 | 152 | 
| 153     // Paint the layer with a null canvas to get a display list, and then | 153     // Paint the layer with a null canvas to get a display list, and then | 
| 154     // replay that onto the mock canvas for examination. | 154     // replay that onto the mock canvas for examination. | 
| 155     PaintController* paintController = graphicsLayer->paintController(); | 155     PaintController* paintController = graphicsLayer->paintController(); | 
| 156     ASSERT(paintController); | 156     ASSERT(paintController); | 
| 157     GraphicsContext graphicsContext(*paintController); | 157     GraphicsContext graphicsContext(*paintController); | 
| 158     graphicsLayer->paint(graphicsContext, rect); | 158     IntRect intRect = rect; | 
|  | 159     graphicsLayer->paint(graphicsContext, &intRect); | 
| 159 | 160 | 
| 160     graphicsContext.beginRecording(IntRect(rect)); | 161     graphicsContext.beginRecording(intRect); | 
| 161     paintController->commitNewDisplayItems(); | 162     paintController->commitNewDisplayItems(); | 
| 162     paintController->paintArtifact().replay(graphicsContext); | 163     paintController->paintArtifact().replay(graphicsContext); | 
| 163     graphicsContext.endRecording()->playback(&canvas); | 164     graphicsContext.endRecording()->playback(&canvas); | 
| 164 } | 165 } | 
| 165 | 166 | 
| 166 TEST_F(PageOverlayTest, SimpleCanvasOverlay_AcceleratedCompositing) | 167 TEST_F(PageOverlayTest, SimpleCanvasOverlay_AcceleratedCompositing) | 
| 167 { | 168 { | 
| 168     runPageOverlayTestWithAcceleratedCompositing<SimpleCanvasOverlay>(); | 169     runPageOverlayTestWithAcceleratedCompositing<SimpleCanvasOverlay>(); | 
| 169 } | 170 } | 
| 170 | 171 | 
| 171 TEST_F(PageOverlayTest, PrivateGraphicsContextOverlay_AcceleratedCompositing) | 172 TEST_F(PageOverlayTest, PrivateGraphicsContextOverlay_AcceleratedCompositing) | 
| 172 { | 173 { | 
| 173     runPageOverlayTestWithAcceleratedCompositing<PrivateGraphicsContextOverlay>(
     ); | 174     runPageOverlayTestWithAcceleratedCompositing<PrivateGraphicsContextOverlay>(
     ); | 
| 174 } | 175 } | 
| 175 | 176 | 
| 176 } // namespace | 177 } // namespace | 
| 177 } // namespace blink | 178 } // namespace blink | 
| OLD | NEW | 
|---|