| 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 | 8 |
| 9 #include "SkPDFShader.h" | 9 #include "SkPDFShader.h" |
| 10 | 10 |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 get_pdf_shader_by_state(doc, dpi, &alphaToLuminosityState)); | 699 get_pdf_shader_by_state(doc, dpi, &alphaToLuminosityState)); |
| 700 | 700 |
| 701 std::unique_ptr<SkStreamAsset> alphaStream(create_pattern_fill_content(-1, b
box)); | 701 std::unique_ptr<SkStreamAsset> alphaStream(create_pattern_fill_content(-1, b
box)); |
| 702 | 702 |
| 703 auto resources = | 703 auto resources = |
| 704 get_gradient_resource_dict(luminosityShader.get(), nullptr); | 704 get_gradient_resource_dict(luminosityShader.get(), nullptr); |
| 705 | 705 |
| 706 auto alphaMask = SkPDFMakeFormXObject(std::move(alphaStream), | 706 auto alphaMask = SkPDFMakeFormXObject(std::move(alphaStream), |
| 707 SkPDFUtils::RectToArray(bbox), | 707 SkPDFUtils::RectToArray(bbox), |
| 708 std::move(resources), | 708 std::move(resources), |
| 709 SkMatrix::I(), |
| 709 "DeviceRGB"); | 710 "DeviceRGB"); |
| 710 return SkPDFGraphicState::GetSMaskGraphicState( | 711 return SkPDFGraphicState::GetSMaskGraphicState( |
| 711 alphaMask.get(), false, | 712 alphaMask.get(), false, |
| 712 SkPDFGraphicState::kLuminosity_SMaskMode, doc->canon()); | 713 SkPDFGraphicState::kLuminosity_SMaskMode, doc->canon()); |
| 713 } | 714 } |
| 714 | 715 |
| 715 SkPDFAlphaFunctionShader* SkPDFAlphaFunctionShader::Create( | 716 SkPDFAlphaFunctionShader* SkPDFAlphaFunctionShader::Create( |
| 716 SkPDFDocument* doc, | 717 SkPDFDocument* doc, |
| 717 SkScalar dpi, | 718 SkScalar dpi, |
| 718 std::unique_ptr<SkPDFShader::State>* autoState) { | 719 std::unique_ptr<SkPDFShader::State>* autoState) { |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1409 return false; | 1410 return false; |
| 1410 } | 1411 } |
| 1411 | 1412 |
| 1412 void SkPDFShader::State::AllocateGradientInfoStorage() { | 1413 void SkPDFShader::State::AllocateGradientInfoStorage() { |
| 1413 fColorData.set(sk_malloc_throw( | 1414 fColorData.set(sk_malloc_throw( |
| 1414 fInfo.fColorCount * (sizeof(SkColor) + sizeof(SkScalar)))); | 1415 fInfo.fColorCount * (sizeof(SkColor) + sizeof(SkScalar)))); |
| 1415 fInfo.fColors = reinterpret_cast<SkColor*>(fColorData.get()); | 1416 fInfo.fColors = reinterpret_cast<SkColor*>(fColorData.get()); |
| 1416 fInfo.fColorOffsets = | 1417 fInfo.fColorOffsets = |
| 1417 reinterpret_cast<SkScalar*>(fInfo.fColors + fInfo.fColorCount); | 1418 reinterpret_cast<SkScalar*>(fInfo.fColors + fInfo.fColorCount); |
| 1418 } | 1419 } |
| OLD | NEW |