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

Side by Side Diff: src/pdf/SkPDFShader.cpp

Issue 2197623002: SkPDF: flip saveLayer rightside up (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 | « src/pdf/SkPDFFormXObject.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 /* 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
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
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 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFFormXObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698