OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkDevice.h" | 9 #include "SkDevice.h" |
10 #include "SkForceLinking.h" | 10 #include "SkForceLinking.h" |
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 | 1448 |
1449 static PdfResult PdfOp_SC(PdfContext* pdfContext, SkCanvas* canvas, PdfTokenLoop
er** looper) { | 1449 static PdfResult PdfOp_SC(PdfContext* pdfContext, SkCanvas* canvas, PdfTokenLoop
er** looper) { |
1450 return PdfOp_SC_sc(pdfContext, canvas, &pdfContext->fGraphicsState.fStroking
); | 1450 return PdfOp_SC_sc(pdfContext, canvas, &pdfContext->fGraphicsState.fStroking
); |
1451 } | 1451 } |
1452 | 1452 |
1453 static PdfResult PdfOp_sc(PdfContext* pdfContext, SkCanvas* canvas, PdfTokenLoop
er** looper) { | 1453 static PdfResult PdfOp_sc(PdfContext* pdfContext, SkCanvas* canvas, PdfTokenLoop
er** looper) { |
1454 return PdfOp_SC_sc(pdfContext, canvas, &pdfContext->fGraphicsState.fNonStrok
ing); | 1454 return PdfOp_SC_sc(pdfContext, canvas, &pdfContext->fGraphicsState.fNonStrok
ing); |
1455 } | 1455 } |
1456 | 1456 |
1457 static PdfResult PdfOp_SCN_scn(PdfContext* pdfContext, SkCanvas* canvas, SkPdfCo
lorOperator* colorOperator) { | 1457 static PdfResult PdfOp_SCN_scn(PdfContext* pdfContext, SkCanvas* canvas, SkPdfCo
lorOperator* colorOperator) { |
1458 //SkPdfString* name; | |
1459 if (pdfContext->fObjectStack.top()->isName()) { | 1458 if (pdfContext->fObjectStack.top()->isName()) { |
1460 // TODO(edisonn): get name, pass it | 1459 SkPdfObject* name = pdfContext->fObjectStack.top(); pdfContext->fObje
ctStack.pop(); |
1461 pdfContext->fObjectStack.pop(); | 1460 |
| 1461 //Next, get the ExtGState Dictionary from the Resource Dictionary: |
| 1462 SkPdfDictionary* extGStateDictionary = pdfContext->fGraphicsState.fResou
rces->Pattern(pdfContext->fPdfDoc); |
| 1463 |
| 1464 if (extGStateDictionary == NULL) { |
| 1465 #ifdef PDF_TRACE |
| 1466 printf("ExtGState is NULL!\n"); |
| 1467 #endif |
| 1468 return kIgnoreError_PdfResult; |
| 1469 } |
| 1470 |
| 1471 /*SkPdfObject* value = */pdfContext->fPdfDoc->resolveReference(extGState
Dictionary->get(name)); |
1462 } | 1472 } |
1463 | 1473 |
1464 // TODO(edisonn): SCN supports more color spaces than SCN. Read and implemen
t spec. | 1474 // TODO(edisonn): SCN supports more color spaces than SCN. Read and implemen
t spec. |
1465 PdfOp_SC_sc(pdfContext, canvas, colorOperator); | 1475 PdfOp_SC_sc(pdfContext, canvas, colorOperator); |
1466 | 1476 |
1467 return kPartial_PdfResult; | 1477 return kPartial_PdfResult; |
1468 } | 1478 } |
1469 | 1479 |
1470 static PdfResult PdfOp_SCN(PdfContext* pdfContext, SkCanvas* canvas, PdfTokenLoo
per** looper) { | 1480 static PdfResult PdfOp_SCN(PdfContext* pdfContext, SkCanvas* canvas, PdfTokenLoo
per** looper) { |
1471 return PdfOp_SCN_scn(pdfContext, canvas, &pdfContext->fGraphicsState.fStroki
ng); | 1481 return PdfOp_SCN_scn(pdfContext, canvas, &pdfContext->fGraphicsState.fStroki
ng); |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2443 | 2453 |
2444 rect = SkRect::MakeWH(width, height); | 2454 rect = SkRect::MakeWH(width, height); |
2445 | 2455 |
2446 setup_bitmap(output, (int)SkScalarToDouble(width), (int)SkScalarToDouble(hei
ght)); | 2456 setup_bitmap(output, (int)SkScalarToDouble(width), (int)SkScalarToDouble(hei
ght)); |
2447 | 2457 |
2448 SkAutoTUnref<SkDevice> device(SkNEW_ARGS(SkDevice, (*output))); | 2458 SkAutoTUnref<SkDevice> device(SkNEW_ARGS(SkDevice, (*output))); |
2449 SkCanvas canvas(device); | 2459 SkCanvas canvas(device); |
2450 | 2460 |
2451 return renderer.renderPage(page, &canvas, rect); | 2461 return renderer.renderPage(page, &canvas, rect); |
2452 } | 2462 } |
OLD | NEW |