| 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 "web/PageOverlay.h" | 5 #include "web/PageOverlay.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/layout/LayoutView.h" | 8 #include "core/layout/LayoutView.h" |
| 9 #include "platform/graphics/Color.h" | 9 #include "platform/graphics/Color.h" |
| 10 #include "platform/graphics/GraphicsContext.h" | 10 #include "platform/graphics/GraphicsContext.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 EXPECT_CALL(canvas, onDrawRect(SkRect::MakeWH(viewportWidth, viewportHeight)
, Property(&SkPaint::getColor, SK_ColorYELLOW))); | 120 EXPECT_CALL(canvas, onDrawRect(SkRect::MakeWH(viewportWidth, viewportHeight)
, Property(&SkPaint::getColor, SK_ColorYELLOW))); |
| 121 | 121 |
| 122 GraphicsLayer* graphicsLayer = pageOverlay->graphicsLayer(); | 122 GraphicsLayer* graphicsLayer = pageOverlay->graphicsLayer(); |
| 123 WebRect rect(0, 0, viewportWidth, viewportHeight); | 123 WebRect rect(0, 0, viewportWidth, viewportHeight); |
| 124 | 124 |
| 125 // Paint the layer with a null canvas to get a display list, and then | 125 // Paint the layer with a null canvas to get a display list, and then |
| 126 // replay that onto the mock canvas for examination. | 126 // replay that onto the mock canvas for examination. |
| 127 IntRect intRect = rect; | 127 IntRect intRect = rect; |
| 128 graphicsLayer->paint(&intRect); | 128 graphicsLayer->paint(&intRect); |
| 129 | 129 |
| 130 PaintController& paintController = graphicsLayer->paintController(); | 130 PaintController& paintController = graphicsLayer->getPaintController(); |
| 131 GraphicsContext graphicsContext(paintController); | 131 GraphicsContext graphicsContext(paintController); |
| 132 graphicsContext.beginRecording(intRect); | 132 graphicsContext.beginRecording(intRect); |
| 133 paintController.paintArtifact().replay(graphicsContext); | 133 paintController.paintArtifact().replay(graphicsContext); |
| 134 graphicsContext.endRecording()->playback(&canvas); | 134 graphicsContext.endRecording()->playback(&canvas); |
| 135 } | 135 } |
| 136 | 136 |
| 137 } // namespace | 137 } // namespace |
| 138 } // namespace blink | 138 } // namespace blink |
| OLD | NEW |