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

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

Issue 783493002: Change clear() to respect the clip (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « src/image/SkSurface_Gpu.cpp ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 fShaderResources.unrefAll(); 794 fShaderResources.unrefAll();
795 SkSafeUnref(fAnnotations); 795 SkSafeUnref(fAnnotations);
796 SkSafeUnref(fResourceDict); 796 SkSafeUnref(fResourceDict);
797 fNamedDestinations.deleteAll(); 797 fNamedDestinations.deleteAll();
798 798
799 if (clearFontUsage) { 799 if (clearFontUsage) {
800 fFontGlyphUsage->reset(); 800 fFontGlyphUsage->reset();
801 } 801 }
802 } 802 }
803 803
804 void SkPDFDevice::clear(SkColor color) {
805 this->cleanUp(true);
806 this->init();
807
808 SkPaint paint;
809 paint.setColor(color);
810 paint.setStyle(SkPaint::kFill_Style);
811 SkMatrix identity;
812 identity.reset();
813 ScopedContentEntry content(this, &fExistingClipStack, fExistingClipRegion,
814 identity, paint);
815 internalDrawPaint(paint, content.entry());
816 }
817
818 void SkPDFDevice::drawPaint(const SkDraw& d, const SkPaint& paint) { 804 void SkPDFDevice::drawPaint(const SkDraw& d, const SkPaint& paint) {
819 SkPaint newPaint = paint; 805 SkPaint newPaint = paint;
820 newPaint.setStyle(SkPaint::kFill_Style); 806 newPaint.setStyle(SkPaint::kFill_Style);
821 ScopedContentEntry content(this, d, newPaint); 807 ScopedContentEntry content(this, d, newPaint);
822 internalDrawPaint(newPaint, content.entry()); 808 internalDrawPaint(newPaint, content.entry());
823 } 809 }
824 810
825 void SkPDFDevice::internalDrawPaint(const SkPaint& paint, 811 void SkPDFDevice::internalDrawPaint(const SkPaint& paint,
826 ContentEntry* contentEntry) { 812 ContentEntry* contentEntry) {
827 if (!contentEntry) { 813 if (!contentEntry) {
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after
2203 SkAutoTUnref<SkPDFObject> image( 2189 SkAutoTUnref<SkPDFObject> image(
2204 SkPDFCreateImageObject(*bitmap, subset, fEncoder)); 2190 SkPDFCreateImageObject(*bitmap, subset, fEncoder));
2205 if (!image) { 2191 if (!image) {
2206 return; 2192 return;
2207 } 2193 }
2208 2194
2209 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()), 2195 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()),
2210 &content.entry()->fContent); 2196 &content.entry()->fContent);
2211 } 2197 }
2212 2198
OLDNEW
« no previous file with comments | « src/image/SkSurface_Gpu.cpp ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698