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

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

Issue 24615006: rebaseline drawbitmap gms (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: remove expectation included by mistake in another cl Created 7 years, 2 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 | Annotate | Revision Log
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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 fInitialTransform.setTranslate(0, SkIntToScalar(pageSize.fHeight)); 700 fInitialTransform.setTranslate(0, SkIntToScalar(pageSize.fHeight));
701 fInitialTransform.preScale(SK_Scalar1, -SK_Scalar1); 701 fInitialTransform.preScale(SK_Scalar1, -SK_Scalar1);
702 fInitialTransform.preConcat(initialTransform); 702 fInitialTransform.preConcat(initialTransform);
703 703
704 SkIRect existingClip = SkIRect::MakeWH(this->width(), this->height()); 704 SkIRect existingClip = SkIRect::MakeWH(this->width(), this->height());
705 fExistingClipRegion.setRect(existingClip); 705 fExistingClipRegion.setRect(existingClip);
706 706
707 this->init(); 707 this->init();
708 } 708 }
709 709
710 SkISize SkSizeToISize(const SkSize& size) {
711 return SkISize::Make(SkScalarRoundToInt(size.width()), SkScalarRoundToInt(si ze.height()));
712 }
713
714 SkPDFDevice::SkPDFDevice(const SkSize& trimBox, const SkRect& content)
715 : SkBitmapDevice(makeContentBitmap(SkSizeToISize(SkSize::Make(content.width( ), content.height())), NULL)),
716 fPageSize(SkSizeToISize(trimBox)),
717 fContentSize(SkSizeToISize(SkSize::Make(content.width(), content.height()) )),
718 fLastContentEntry(NULL),
719 fLastMarginContentEntry(NULL),
720 fClipStack(NULL),
721 fEncoder(NULL) {
722 // Skia generally uses the top left as the origin but PDF natively has the
723 // origin at the bottom left. This matrix corrects for that. But that only
724 // needs to be done once, we don't do it when layering.
725 fInitialTransform.reset();
726 fInitialTransform.setTranslate(0, SkIntToScalar(trimBox.height()));
727 fInitialTransform.preScale(SK_Scalar1, -SK_Scalar1);
728
729 SkIRect existingClip = SkIRect::MakeWH(this->width(), this->height());
730 fExistingClipRegion.setRect(existingClip);
731
732 this->init();
733 }
734
735
710 // TODO(vandebo) change layerSize to SkSize. 736 // TODO(vandebo) change layerSize to SkSize.
711 SkPDFDevice::SkPDFDevice(const SkISize& layerSize, 737 SkPDFDevice::SkPDFDevice(const SkISize& layerSize,
712 const SkClipStack& existingClipStack, 738 const SkClipStack& existingClipStack,
713 const SkRegion& existingClipRegion) 739 const SkRegion& existingClipRegion)
714 : SkBitmapDevice(makeContentBitmap(layerSize, NULL)), 740 : SkBitmapDevice(makeContentBitmap(layerSize, NULL)),
715 fPageSize(layerSize), 741 fPageSize(layerSize),
716 fContentSize(layerSize), 742 fContentSize(layerSize),
717 fExistingClipStack(existingClipStack), 743 fExistingClipStack(existingClipStack),
718 fExistingClipRegion(existingClipRegion), 744 fExistingClipRegion(existingClipRegion),
719 fLastContentEntry(NULL), 745 fLastContentEntry(NULL),
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1936 } 1962 }
1937 1963
1938 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, 1964 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y,
1939 SkCanvas::Config8888) { 1965 SkCanvas::Config8888) {
1940 return false; 1966 return false;
1941 } 1967 }
1942 1968
1943 bool SkPDFDevice::allowImageFilter(SkImageFilter*) { 1969 bool SkPDFDevice::allowImageFilter(SkImageFilter*) {
1944 return false; 1970 return false;
1945 } 1971 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698