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

Unified Diff: third_party/WebKit/Source/core/paint/TextPainterTest.cpp

Issue 1512803004: Use refs for GraphicsContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarTheme
Patch Set: Created 5 years 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: third_party/WebKit/Source/core/paint/TextPainterTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/TextPainterTest.cpp b/third_party/WebKit/Source/core/paint/TextPainterTest.cpp
index e8b43a0202ed50395b0ad134e2052e4bf37b1859..60ef0a5b6309189b90fd9573fd07e0e765acf005 100644
--- a/third_party/WebKit/Source/core/paint/TextPainterTest.cpp
+++ b/third_party/WebKit/Source/core/paint/TextPainterTest.cpp
@@ -14,6 +14,7 @@
#include "core/paint/PaintInfo.h"
#include "core/style/ShadowData.h"
#include "core/style/ShadowList.h"
+#include "platform/graphics/paint/PaintController.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace blink {
@@ -21,11 +22,20 @@ namespace {
class TextPainterTest : public RenderingTest {
public:
- TextPainterTest() : m_layoutText(nullptr) { }
+ TextPainterTest()
+ : m_layoutText(nullptr)
+ , m_paintController(PaintController::create())
+ , m_context(*m_paintController)
+ { }
protected:
LayoutText* layoutText() { return m_layoutText; }
+ PaintInfo createPaintInfo(bool usesTextAsClip, bool isPrinting)
+ {
+ return PaintInfo(m_context, IntRect(), usesTextAsClip ? PaintPhaseTextClip : PaintPhaseBlockBackground, isPrinting ? GlobalPaintPrinting : GlobalPaintNormalPhase, 0);
+ }
+
private:
void SetUp() override
{
@@ -37,13 +47,10 @@ private:
}
LayoutText* m_layoutText;
+ OwnPtr<PaintController> m_paintController;
+ GraphicsContext m_context;
};
-static PaintInfo createPaintInfo(bool usesTextAsClip, bool isPrinting)
-{
- return PaintInfo(nullptr, IntRect(), usesTextAsClip ? PaintPhaseTextClip : PaintPhaseBlockBackground, isPrinting ? GlobalPaintPrinting : GlobalPaintNormalPhase, 0);
-}
-
TEST_F(TextPainterTest, TextPaintingStyle_Simple)
{
document().body()->setInlineStyleProperty(CSSPropertyColor, CSSValueBlue);
« no previous file with comments | « third_party/WebKit/Source/core/paint/TextPainter.cpp ('k') | third_party/WebKit/Source/core/paint/ThemePainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698