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

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

Issue 424663006: SkCanvas interface for drawing a patch. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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
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 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after
1330 int vertexCount, const SkPoint verts[], 1330 int vertexCount, const SkPoint verts[],
1331 const SkPoint texs[], const SkColor colors[], 1331 const SkPoint texs[], const SkColor colors[],
1332 SkXfermode* xmode, const uint16_t indices[], 1332 SkXfermode* xmode, const uint16_t indices[],
1333 int indexCount, const SkPaint& paint) { 1333 int indexCount, const SkPaint& paint) {
1334 if (d.fClip->isEmpty()) { 1334 if (d.fClip->isEmpty()) {
1335 return; 1335 return;
1336 } 1336 }
1337 // TODO: implement drawVertices 1337 // TODO: implement drawVertices
1338 } 1338 }
1339 1339
1340 void SkPDFDevice::drawPatch(const SkDraw&, const SkPatch& patch, const SkPaint& paint) {
1341 //TODO
1342 }
1343
1340 void SkPDFDevice::drawDevice(const SkDraw& d, SkBaseDevice* device, 1344 void SkPDFDevice::drawDevice(const SkDraw& d, SkBaseDevice* device,
1341 int x, int y, const SkPaint& paint) { 1345 int x, int y, const SkPaint& paint) {
1342 // our onCreateDevice() always creates SkPDFDevice subclasses. 1346 // our onCreateDevice() always creates SkPDFDevice subclasses.
1343 SkPDFDevice* pdfDevice = static_cast<SkPDFDevice*>(device); 1347 SkPDFDevice* pdfDevice = static_cast<SkPDFDevice*>(device);
1344 if (pdfDevice->isContentEmpty()) { 1348 if (pdfDevice->isContentEmpty()) {
1345 return; 1349 return;
1346 } 1350 }
1347 1351
1348 SkMatrix matrix; 1352 SkMatrix matrix;
1349 matrix.setTranslate(SkIntToScalar(x), SkIntToScalar(y)); 1353 matrix.setTranslate(SkIntToScalar(x), SkIntToScalar(y));
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
2311 SkAutoTUnref<SkPDFImage> image( 2315 SkAutoTUnref<SkPDFImage> image(
2312 SkPDFImage::CreateImage(*bitmap, subset, fEncoder)); 2316 SkPDFImage::CreateImage(*bitmap, subset, fEncoder));
2313 if (!image) { 2317 if (!image) {
2314 return; 2318 return;
2315 } 2319 }
2316 2320
2317 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()), 2321 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()),
2318 &content.entry()->fContent); 2322 &content.entry()->fContent);
2319 } 2323 }
2320 2324
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698