OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef UNICODE | 8 #ifndef UNICODE |
9 #define UNICODE | 9 #define UNICODE |
10 #endif | 10 #endif |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
943 info.fColorOffsets = NULL; | 943 info.fColorOffsets = NULL; |
944 SkShader::GradientType gradientType = shader->asAGradient(&info); | 944 SkShader::GradientType gradientType = shader->asAGradient(&info); |
945 | 945 |
946 if (SkShader::kNone_GradientType == gradientType) { | 946 if (SkShader::kNone_GradientType == gradientType) { |
947 //Nothing to see, move along. | 947 //Nothing to see, move along. |
948 | 948 |
949 } else if (SkShader::kColor_GradientType == gradientType) { | 949 } else if (SkShader::kColor_GradientType == gradientType) { |
950 SkASSERT(1 == info.fColorCount); | 950 SkASSERT(1 == info.fColorCount); |
951 SkColor color; | 951 SkColor color; |
952 info.fColors = &color; | 952 info.fColors = &color; |
953 SkShader::GradientType gradientType = shader->asAGradient(&info); | |
reed1
2013/03/21 13:14:24
Why did we eliminate this line, given that we insp
bsalomon
2013/03/21 13:45:29
I misunderstood the code and thought these calls w
| |
954 SkAlpha alpha = skPaint.getAlpha(); | 953 SkAlpha alpha = skPaint.getAlpha(); |
955 HR(this->createXpsSolidColorBrush(color, alpha, brush)); | 954 HR(this->createXpsSolidColorBrush(color, alpha, brush)); |
956 return S_OK; | 955 return S_OK; |
957 | 956 |
958 } else { | 957 } else { |
959 if (info.fColorCount == 0) { | 958 if (info.fColorCount == 0) { |
960 const SkColor color = skPaint.getColor(); | 959 const SkColor color = skPaint.getColor(); |
961 HR(this->createXpsSolidColorBrush(color, 0xFF, brush)); | 960 HR(this->createXpsSolidColorBrush(color, 0xFF, brush)); |
962 return S_OK; | 961 return S_OK; |
963 } | 962 } |
964 | 963 |
965 SkAutoTArray<SkColor> colors(info.fColorCount); | 964 SkAutoTArray<SkColor> colors(info.fColorCount); |
966 SkAutoTArray<SkScalar> colorOffsets(info.fColorCount); | 965 SkAutoTArray<SkScalar> colorOffsets(info.fColorCount); |
967 info.fColors = colors.get(); | 966 info.fColors = colors.get(); |
968 info.fColorOffsets = colorOffsets.get(); | 967 info.fColorOffsets = colorOffsets.get(); |
969 shader->asAGradient(&info); | |
reed1
2013/03/21 13:14:24
Why did we eliminate this call, given that we insp
| |
970 | 968 |
971 if (1 == info.fColorCount) { | 969 if (1 == info.fColorCount) { |
972 SkColor color = info.fColors[0]; | 970 SkColor color = info.fColors[0]; |
973 SkAlpha alpha = skPaint.getAlpha(); | 971 SkAlpha alpha = skPaint.getAlpha(); |
974 HR(this->createXpsSolidColorBrush(color, alpha, brush)); | 972 HR(this->createXpsSolidColorBrush(color, alpha, brush)); |
975 return S_OK; | 973 return S_OK; |
976 } | 974 } |
977 | 975 |
978 SkMatrix localMatrix = shader->getLocalMatrix(); | 976 SkMatrix localMatrix = shader->getLocalMatrix(); |
979 if (NULL != parentTransform) { | 977 if (NULL != parentTransform) { |
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2410 IID_PPV_ARGS(&this->fXpsFactory)), | 2408 IID_PPV_ARGS(&this->fXpsFactory)), |
2411 "Could not create factory for layer."); | 2409 "Could not create factory for layer."); |
2412 | 2410 |
2413 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas), | 2411 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas), |
2414 "Could not create canvas for layer."); | 2412 "Could not create canvas for layer."); |
2415 } | 2413 } |
2416 | 2414 |
2417 bool SkXPSDevice::allowImageFilter(SkImageFilter*) { | 2415 bool SkXPSDevice::allowImageFilter(SkImageFilter*) { |
2418 return false; | 2416 return false; |
2419 } | 2417 } |
OLD | NEW |