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

Side by Side Diff: third_party/WebKit/Source/core/paint/TextPainterTest.cpp

Issue 1584903002: Improvement handling of background and outline paint phases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@PaintPhaseRename
Patch Set: Created 4 years, 11 months 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/TableSectionPainter.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "core/paint/TextPainter.h" 5 #include "core/paint/TextPainter.h"
6 6
7 #include "core/CSSPropertyNames.h" 7 #include "core/CSSPropertyNames.h"
8 #include "core/CSSValueKeywords.h" 8 #include "core/CSSValueKeywords.h"
9 #include "core/css/CSSPrimitiveValue.h" 9 #include "core/css/CSSPrimitiveValue.h"
10 #include "core/frame/Settings.h" 10 #include "core/frame/Settings.h"
(...skipping 14 matching lines...) Expand all
25 : m_layoutText(nullptr) 25 : m_layoutText(nullptr)
26 , m_paintController(PaintController::create()) 26 , m_paintController(PaintController::create())
27 , m_context(*m_paintController) 27 , m_context(*m_paintController)
28 { } 28 { }
29 29
30 protected: 30 protected:
31 LayoutText* layoutText() { return m_layoutText; } 31 LayoutText* layoutText() { return m_layoutText; }
32 32
33 PaintInfo createPaintInfo(bool usesTextAsClip, bool isPrinting) 33 PaintInfo createPaintInfo(bool usesTextAsClip, bool isPrinting)
34 { 34 {
35 return PaintInfo(m_context, IntRect(), usesTextAsClip ? PaintPhaseTextCl ip : PaintPhaseSelfBlockBackground, isPrinting ? GlobalPaintPrinting : GlobalPai ntNormalPhase, 0); 35 return PaintInfo(m_context, IntRect(), usesTextAsClip ? PaintPhaseTextCl ip : PaintPhaseSelfBlockBackgroundOnly, isPrinting ? GlobalPaintPrinting : Globa lPaintNormalPhase, 0);
36 } 36 }
37 37
38 private: 38 private:
39 void SetUp() override 39 void SetUp() override
40 { 40 {
41 RenderingTest::SetUp(); 41 RenderingTest::SetUp();
42 setBodyInnerHTML("Hello world"); 42 setBodyInnerHTML("Hello world");
43 m_layoutText = toLayoutText(document().body()->firstChild()->layoutObjec t()); 43 m_layoutText = toLayoutText(document().body()->firstChild()->layoutObjec t());
44 ASSERT_TRUE(m_layoutText); 44 ASSERT_TRUE(m_layoutText);
45 ASSERT_EQ("Hello world", m_layoutText->text()); 45 ASSERT_EQ("Hello world", m_layoutText->text());
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 TextPainter::Style textStyle = TextPainter::textPaintingStyle( 135 TextPainter::Style textStyle = TextPainter::textPaintingStyle(
136 *layoutText(), layoutText()->styleRef(), createPaintInfo(false /* usesTe xtAsClip */, true /* isPrinting */)); 136 *layoutText(), layoutText()->styleRef(), createPaintInfo(false /* usesTe xtAsClip */, true /* isPrinting */));
137 EXPECT_EQ(Color(255, 220, 220).dark(), textStyle.fillColor); 137 EXPECT_EQ(Color(255, 220, 220).dark(), textStyle.fillColor);
138 EXPECT_EQ(Color(220, 255, 220).dark(), textStyle.strokeColor); 138 EXPECT_EQ(Color(220, 255, 220).dark(), textStyle.strokeColor);
139 EXPECT_EQ(Color(220, 220, 255).dark(), textStyle.emphasisMarkColor); 139 EXPECT_EQ(Color(220, 220, 255).dark(), textStyle.emphasisMarkColor);
140 } 140 }
141 141
142 } // namespace 142 } // namespace
143 } // namespace blink 143 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/TableSectionPainter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698