| OLD | NEW | 
|---|
| 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 "platform/graphics/paint/PaintController.h" | 5 #include "platform/graphics/paint/PaintController.h" | 
| 6 | 6 | 
| 7 #include "platform/RuntimeEnabledFeatures.h" | 7 #include "platform/RuntimeEnabledFeatures.h" | 
| 8 #include "platform/graphics/GraphicsContext.h" | 8 #include "platform/graphics/GraphicsContext.h" | 
| 9 #include "platform/graphics/paint/CachedDisplayItem.h" | 9 #include "platform/graphics/paint/CachedDisplayItem.h" | 
| 10 #include "platform/graphics/paint/ClipPathRecorder.h" | 10 #include "platform/graphics/paint/ClipPathRecorder.h" | 
| 11 #include "platform/graphics/paint/ClipRecorder.h" | 11 #include "platform/graphics/paint/ClipRecorder.h" | 
| 12 #include "platform/graphics/paint/DrawingDisplayItem.h" | 12 #include "platform/graphics/paint/DrawingDisplayItem.h" | 
| 13 #include "platform/graphics/paint/DrawingRecorder.h" | 13 #include "platform/graphics/paint/DrawingRecorder.h" | 
| 14 #include "platform/graphics/paint/SubsequenceRecorder.h" | 14 #include "platform/graphics/paint/SubsequenceRecorder.h" | 
| 15 #include "platform/testing/FakeDisplayItemClient.h" | 15 #include "platform/testing/FakeDisplayItemClient.h" | 
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" | 
| 17 | 17 | 
| 18 namespace blink { | 18 namespace blink { | 
| 19 | 19 | 
| 20 class PaintControllerTest : public ::testing::Test { | 20 class PaintControllerTest : public ::testing::Test { | 
| 21 public: | 21 public: | 
| 22     PaintControllerTest() | 22     PaintControllerTest() | 
| 23         : m_paintController(PaintController::create()) | 23         : m_paintController(PaintController::create()) | 
| 24         , m_originalSlimmingPaintV2Enabled(RuntimeEnabledFeatures::slimmingPaint
     V2Enabled()) { } | 24         , m_originalSlimmingPaintV2Enabled(RuntimeEnabledFeatures::slimmingPaint
     V2Enabled()) | 
|  | 25     { | 
|  | 26     } | 
| 25 | 27 | 
| 26     IntRect visualRect(const PaintArtifact& paintArtifact, unsigned index) | 28     IntRect visualRect(const PaintArtifact& paintArtifact, unsigned index) | 
| 27     { | 29     { | 
| 28         return paintArtifact.getDisplayItemList().visualRect(index); | 30         return paintArtifact.getDisplayItemList().visualRect(index); | 
| 29     } | 31     } | 
| 30 | 32 | 
| 31 protected: | 33 protected: | 
| 32     PaintController& getPaintController() { return *m_paintController; } | 34     PaintController& getPaintController() { return *m_paintController; } | 
| 33 | 35 | 
| 34 private: | 36 private: | 
| (...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 788     GraphicsContext context(getPaintController()); | 790     GraphicsContext context(getPaintController()); | 
| 789     drawRect(context, client, backgroundDrawingType, FloatRect(0, 0, 100, 100)); | 791     drawRect(context, client, backgroundDrawingType, FloatRect(0, 0, 100, 100)); | 
| 790 | 792 | 
| 791     getPaintController().commitNewDisplayItems(LayoutSize(20, 30)); | 793     getPaintController().commitNewDisplayItems(LayoutSize(20, 30)); | 
| 792     const auto& paintArtifact = getPaintController().paintArtifact(); | 794     const auto& paintArtifact = getPaintController().paintArtifact(); | 
| 793     ASSERT_EQ(1u, paintArtifact.getDisplayItemList().size()); | 795     ASSERT_EQ(1u, paintArtifact.getDisplayItemList().size()); | 
| 794     EXPECT_RECT_EQ(IntRect(-20, -30, 200, 100), visualRect(paintArtifact, 0)); | 796     EXPECT_RECT_EQ(IntRect(-20, -30, 200, 100), visualRect(paintArtifact, 0)); | 
| 795 } | 797 } | 
| 796 | 798 | 
| 797 } // namespace blink | 799 } // namespace blink | 
| OLD | NEW | 
|---|