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

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

Issue 841763005: Generic PDF shader fallback (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: win build fix Created 5 years, 11 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 | « expectations/gm/ignored-tests.txt ('k') | src/pdf/SkPDFShader.h » ('j') | 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 #include "SkPDFDevice.h" 8 #include "SkPDFDevice.h"
9 9
10 #include "SkAnnotation.h" 10 #include "SkAnnotation.h"
(...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after
1943 // a pattern the size of the current clip. 1943 // a pattern the size of the current clip.
1944 SkIRect bounds = clipRegion.getBounds(); 1944 SkIRect bounds = clipRegion.getBounds();
1945 1945
1946 // We need to apply the initial transform to bounds in order to get 1946 // We need to apply the initial transform to bounds in order to get
1947 // bounds in a consistent coordinate system. 1947 // bounds in a consistent coordinate system.
1948 SkRect boundsTemp; 1948 SkRect boundsTemp;
1949 boundsTemp.set(bounds); 1949 boundsTemp.set(bounds);
1950 fInitialTransform.mapRect(&boundsTemp); 1950 fInitialTransform.mapRect(&boundsTemp);
1951 boundsTemp.roundOut(&bounds); 1951 boundsTemp.roundOut(&bounds);
1952 1952
1953 pdfShader.reset(SkPDFShader::GetPDFShader(*shader, transform, bounds)); 1953 pdfShader.reset(SkPDFShader::GetPDFShader(*shader, transform, bounds,
1954 SkIntToScalar(fRasterDpi) / DPI_FOR_RASTER_SCALE_ONE));
1954 1955
1955 if (pdfShader.get()) { 1956 if (pdfShader.get()) {
1956 // pdfShader has been canonicalized so we can directly compare 1957 // pdfShader has been canonicalized so we can directly compare
1957 // pointers. 1958 // pointers.
1958 int resourceIndex = fShaderResources.find(pdfShader.get()); 1959 int resourceIndex = fShaderResources.find(pdfShader.get());
1959 if (resourceIndex < 0) { 1960 if (resourceIndex < 0) {
1960 resourceIndex = fShaderResources.count(); 1961 resourceIndex = fShaderResources.count();
1961 fShaderResources.push(pdfShader.get()); 1962 fShaderResources.push(pdfShader.get());
1962 pdfShader.get()->ref(); 1963 pdfShader.get()->ref();
1963 } 1964 }
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
2188 SkAutoTUnref<SkPDFObject> image( 2189 SkAutoTUnref<SkPDFObject> image(
2189 SkPDFCreateImageObject(*bitmap, subset, fEncoder)); 2190 SkPDFCreateImageObject(*bitmap, subset, fEncoder));
2190 if (!image) { 2191 if (!image) {
2191 return; 2192 return;
2192 } 2193 }
2193 2194
2194 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()), 2195 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()),
2195 &content.entry()->fContent); 2196 &content.entry()->fContent);
2196 } 2197 }
2197 2198
OLDNEW
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | src/pdf/SkPDFShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698