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

Side by Side Diff: src/effects/SkPictureImageFilter.cpp

Issue 1878143004: Make SkSpecialSurfaces always use kUnknown for their pixel geometry (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « src/core/SkSpecialSurface.cpp ('k') | no next file » | 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 2013 The Android Open Source Project 2 * Copyright 2013 The Android Open Source Project
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 "SkPictureImageFilter.h" 8 #include "SkPictureImageFilter.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 sk_sp<SkSpecialSurface> surf(source->makeSurface(info)); 101 sk_sp<SkSpecialSurface> surf(source->makeSurface(info));
102 if (!surf) { 102 if (!surf) {
103 return nullptr; 103 return nullptr;
104 } 104 }
105 105
106 SkCanvas* canvas = surf->getCanvas(); 106 SkCanvas* canvas = surf->getCanvas();
107 SkASSERT(canvas); 107 SkASSERT(canvas);
108 108
109 canvas->clear(0x0); 109 canvas->clear(0x0);
110 110
111 if (kDeviceSpace_PictureResolution == fPictureResolution || 111 if (kDeviceSpace_PictureResolution == fPictureResolution ||
112 0 == (ctx.ctm().getType() & ~SkMatrix::kTranslate_Mask)) { 112 0 == (ctx.ctm().getType() & ~SkMatrix::kTranslate_Mask)) {
113 this->drawPictureAtDeviceResolution(canvas, bounds, ctx); 113 this->drawPictureAtDeviceResolution(canvas, bounds, ctx);
114 } else { 114 } else {
115 this->drawPictureAtLocalResolution(source, canvas, bounds, ctx); 115 this->drawPictureAtLocalResolution(source, canvas, bounds, ctx);
116 } 116 }
117 117
118 offset->fX = bounds.fLeft; 118 offset->fX = bounds.fLeft;
119 offset->fY = bounds.fTop; 119 offset->fY = bounds.fTop;
120 return surf->makeImageSnapshot(); 120 return surf->makeImageSnapshot();
121 } 121 }
122 122
123 void SkPictureImageFilter::drawPictureAtDeviceResolution(SkCanvas* canvas, 123 void SkPictureImageFilter::drawPictureAtDeviceResolution(SkCanvas* canvas,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 str->appendf("crop: (%f,%f,%f,%f) ", 184 str->appendf("crop: (%f,%f,%f,%f) ",
185 fCropRect.fLeft, fCropRect.fTop, fCropRect.fRight, fCropRect.fB ottom); 185 fCropRect.fLeft, fCropRect.fTop, fCropRect.fRight, fCropRect.fB ottom);
186 if (fPicture) { 186 if (fPicture) {
187 str->appendf("picture: (%f,%f,%f,%f)", 187 str->appendf("picture: (%f,%f,%f,%f)",
188 fPicture->cullRect().fLeft, fPicture->cullRect().fTop, 188 fPicture->cullRect().fLeft, fPicture->cullRect().fTop,
189 fPicture->cullRect().fRight, fPicture->cullRect().fBottom); 189 fPicture->cullRect().fRight, fPicture->cullRect().fBottom);
190 } 190 }
191 str->append(")"); 191 str->append(")");
192 } 192 }
193 #endif 193 #endif
OLDNEW
« no previous file with comments | « src/core/SkSpecialSurface.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698