OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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 #if defined(_SKIA_SUPPORT_) | 5 #if defined(_SKIA_SUPPORT_) |
6 #include <algorithm> | 6 #include <algorithm> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "core/fxcodec/include/fx_codec.h" | 9 #include "core/fxcodec/include/fx_codec.h" |
10 #include "core/fxcrt/include/fx_memory.h" | 10 #include "core/fxcrt/include/fx_memory.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 SkMatrix ToSkMatrix(const CFX_Matrix& m) { | 131 SkMatrix ToSkMatrix(const CFX_Matrix& m) { |
132 SkMatrix skMatrix; | 132 SkMatrix skMatrix; |
133 skMatrix.setAll(m.a, m.b, m.e, m.c, m.d, m.f, 0, 0, 1); | 133 skMatrix.setAll(m.a, m.b, m.e, m.c, m.d, m.f, 0, 0, 1); |
134 return skMatrix; | 134 return skMatrix; |
135 } | 135 } |
136 | 136 |
137 // use when pdf's y-axis points up insead of down | 137 // use when pdf's y-axis points up insead of down |
138 SkMatrix ToFlippedSkMatrix(const CFX_Matrix& m) { | 138 SkMatrix ToFlippedSkMatrix(const CFX_Matrix& m) { |
139 SkMatrix skMatrix; | 139 SkMatrix skMatrix; |
140 skMatrix.setAll(m.a, m.b, m.e, -m.c, -m.d, m.f, 0, 0, 1); | 140 skMatrix.setAll(m.a, -m.b, m.e, m.c, -m.d, m.f, 0, 0, 1); |
141 return skMatrix; | 141 return skMatrix; |
142 } | 142 } |
143 | 143 |
144 SkXfermode::Mode GetSkiaBlendMode(int blend_type) { | 144 SkXfermode::Mode GetSkiaBlendMode(int blend_type) { |
145 switch (blend_type) { | 145 switch (blend_type) { |
146 case FXDIB_BLEND_MULTIPLY: | 146 case FXDIB_BLEND_MULTIPLY: |
147 return SkXfermode::kMultiply_Mode; | 147 return SkXfermode::kMultiply_Mode; |
148 case FXDIB_BLEND_SCREEN: | 148 case FXDIB_BLEND_SCREEN: |
149 return SkXfermode::kScreen_Mode; | 149 return SkXfermode::kScreen_Mode; |
150 case FXDIB_BLEND_OVERLAY: | 150 case FXDIB_BLEND_OVERLAY: |
(...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1535 SkA32Assert(a); | 1535 SkA32Assert(a); |
1536 SkASSERT(r <= a); | 1536 SkASSERT(r <= a); |
1537 SkASSERT(g <= a); | 1537 SkASSERT(g <= a); |
1538 SkASSERT(b <= a); | 1538 SkASSERT(b <= a); |
1539 } | 1539 } |
1540 } | 1540 } |
1541 #endif | 1541 #endif |
1542 } | 1542 } |
1543 | 1543 |
1544 #endif | 1544 #endif |
OLD | NEW |