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

Unified Diff: experimental/PdfViewer/SkPdfRenderer.cpp

Issue 21537003: pdfviewer: remove simple implementation for non-isolated groups. will be implemented in skia most p… (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/PdfViewer/SkPdfRenderer.cpp
===================================================================
--- experimental/PdfViewer/SkPdfRenderer.cpp (revision 10467)
+++ experimental/PdfViewer/SkPdfRenderer.cpp (working copy)
@@ -650,6 +650,7 @@
// CON: pathops must be bug free first + time to compute new paths
// pay a price at loading pdf to compute a pdf draw plan
// on average, a load with empty draw is 100ms on all the skps we have, for complete sites
+// 5) for knockout, render the objects in reverse order, and add every object to the clip, and any new draw will be cliped
// TODO(edisonn): draw plan from point! - list of draw ops of a point, like a tree!
@@ -662,34 +663,15 @@
SkBitmap backdrop;
bool isolatedGroup = tgroup->I(pdfContext->fPdfDoc);
// bool knockoutGroup = tgroup->K(pdfContext->fPdfDoc);
- bool hasPixels = false;
- if (!isolatedGroup) {
- // TODO(edisonn): if the rect is not mapable, the operation could be expensive, e.g.
- // a diagonal long but small rect would require to save all the page
- SkMatrix inverse;
- if (pdfContext->fGraphicsState.fCTM.mapRect(&bbox) &&
- canvas->getTotalMatrix().invert(&inverse) &&
- inverse.mapRect(&bbox)) {
- SkIRect area = SkIRect::MakeLTRB(SkScalarTruncToInt(bbox.left()),
- SkScalarTruncToInt(bbox.top()),
- SkScalarTruncToInt(bbox.right()) + 2,
- SkScalarTruncToInt(bbox.bottom()) + 2);
- SkBitmap dummy;
- if (canvas->readPixels(area, &dummy)) {
- hasPixels = true;
- }
- }
- }
SkPaint paint;
pdfContext->fGraphicsState.applyGraphicsState(&paint, false);
canvas->saveLayer(&bboxOrig, isolatedGroup ? &paint : NULL);
-
- if (hasPixels) {
- canvas->drawBitmapRect(backdrop, bboxOrig, NULL);
- }
}
+// TODO(edisonn): non isolation implemented in skia
//static void doGroup_after(PdfContext* pdfContext, SkCanvas* canvas, SkRect bbox, SkPdfTransparencyGroupDictionary* tgroup) {
+// if not isolated
+// canvas->drawBitmapRect(backdrop, bboxOrig, NULL);
//}
static PdfResult doXObject_Form(PdfContext* pdfContext, SkCanvas* canvas, SkPdfType1FormDictionary* skobj) {
@@ -703,8 +685,6 @@
PdfOp_q(pdfContext, canvas, NULL);
-
-
canvas->save();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698