pdfviewer: remove simple implementation for non-isolated groups. will be implemented in skia most probably. also it is not generated by SkPDFDevice
Review URL: https://codereview.chromium.org/21537003
git-svn-id: http://skia.googlecode.com/svn/trunk@10479 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/experimental/PdfViewer/SkPdfRenderer.cpp b/experimental/PdfViewer/SkPdfRenderer.cpp
index f9ced88..5ed7554 100644
--- a/experimental/PdfViewer/SkPdfRenderer.cpp
+++ b/experimental/PdfViewer/SkPdfRenderer.cpp
@@ -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();