OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium 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/fxge/include/cfx_fontcache.h" | 5 #include "core/fxge/include/cfx_fontcache.h" |
6 #include "core/fxge/include/cfx_fxgedevice.h" | 6 #include "core/fxge/include/cfx_fxgedevice.h" |
7 #include "core/fxge/include/cfx_graphstatedata.h" | 7 #include "core/fxge/include/cfx_graphstatedata.h" |
8 #include "core/fxge/include/cfx_pathdata.h" | 8 #include "core/fxge/include/cfx_pathdata.h" |
9 #include "core/fxge/include/cfx_renderdevice.h" | 9 #include "core/fxge/include/cfx_renderdevice.h" |
10 #include "core/fxge/skia/fx_skia_device.h" | 10 #include "core/fxge/skia/fx_skia_device.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 uint32_t m_pixel; | 29 uint32_t m_pixel; |
30 }; | 30 }; |
31 | 31 |
32 void EmptyTest(CFX_SkiaDeviceDriver* driver, const State&) { | 32 void EmptyTest(CFX_SkiaDeviceDriver* driver, const State&) { |
33 driver->SaveState(); | 33 driver->SaveState(); |
34 driver->RestoreState(true); | 34 driver->RestoreState(true); |
35 driver->RestoreState(false); | 35 driver->RestoreState(false); |
36 } | 36 } |
37 | 37 |
38 void CommonTest(CFX_SkiaDeviceDriver* driver, const State& state) { | 38 void CommonTest(CFX_SkiaDeviceDriver* driver, const State& state) { |
39 FXTEXT_CHARPOS charPos[] = {{1, 0, 1, 4, false, {0, 0, 0, 0}, false}}; | 39 FXTEXT_CHARPOS charPos[] = {{{0, 0, 0, 0}, 0, 1, 1, 4, false, false}}; |
40 CFX_Font font; | 40 CFX_Font font; |
41 FX_FLOAT fontSize = 1; | 41 FX_FLOAT fontSize = 1; |
42 CFX_FontCache cache; | 42 CFX_FontCache cache; |
43 CFX_PathData clipPath, clipPath2; | 43 CFX_PathData clipPath, clipPath2; |
44 clipPath.AppendRect(0, 0, 3, 1); | 44 clipPath.AppendRect(0, 0, 3, 1); |
45 clipPath2.AppendRect(0, 0, 2, 1); | 45 clipPath2.AppendRect(0, 0, 2, 1); |
46 CFX_Matrix clipMatrix; | 46 CFX_Matrix clipMatrix; |
47 CFX_Matrix clipMatrix2(1, 0, 0, 1, 0, 1); | 47 CFX_Matrix clipMatrix2(1, 0, 0, 1, 0, 1); |
48 driver->SaveState(); | 48 driver->SaveState(); |
49 CFX_PathData path1; | 49 CFX_PathData path1; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 Harness(&CommonTest, | 159 Harness(&CommonTest, |
160 {State::Change::kNo, State::Save::kYes, State::Clip::kDifferentMatrix, | 160 {State::Change::kNo, State::Save::kYes, State::Clip::kDifferentMatrix, |
161 State::Graphic::kText, 0xFF445566}); | 161 State::Graphic::kText, 0xFF445566}); |
162 Harness(&CommonTest, {State::Change::kNo, State::Save::kYes, | 162 Harness(&CommonTest, {State::Change::kNo, State::Save::kYes, |
163 State::Clip::kSame, State::Graphic::kText, 0xFF445566}); | 163 State::Clip::kSame, State::Graphic::kText, 0xFF445566}); |
164 } | 164 } |
165 | 165 |
166 TEST(fxge, SkiaStateOOSClip) { | 166 TEST(fxge, SkiaStateOOSClip) { |
167 Harness(&OutOfSequenceClipTest, {}); | 167 Harness(&OutOfSequenceClipTest, {}); |
168 } | 168 } |
OLD | NEW |