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

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

Issue 948693002: remove dead code from sampleapp, trim bad asserts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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 | « samplecode/SampleApp.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 2012 The Android Open Source Project 2 * Copyright 2012 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkMagnifierImageFilter.h" 9 #include "SkMagnifierImageFilter.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 284
285 void SkMagnifierImageFilter::flatten(SkWriteBuffer& buffer) const { 285 void SkMagnifierImageFilter::flatten(SkWriteBuffer& buffer) const {
286 this->INHERITED::flatten(buffer); 286 this->INHERITED::flatten(buffer);
287 buffer.writeRect(fSrcRect); 287 buffer.writeRect(fSrcRect);
288 buffer.writeScalar(fInset); 288 buffer.writeScalar(fInset);
289 } 289 }
290 290
291 bool SkMagnifierImageFilter::onFilterImage(Proxy*, const SkBitmap& src, 291 bool SkMagnifierImageFilter::onFilterImage(Proxy*, const SkBitmap& src,
292 const Context&, SkBitmap* dst, 292 const Context&, SkBitmap* dst,
293 SkIPoint* offset) const { 293 SkIPoint* offset) const {
294 SkASSERT(src.colorType() == kN32_SkColorType);
295 SkASSERT(fSrcRect.width() < src.width());
296 SkASSERT(fSrcRect.height() < src.height());
297
298 if ((src.colorType() != kN32_SkColorType) || 294 if ((src.colorType() != kN32_SkColorType) ||
299 (fSrcRect.width() >= src.width()) || 295 (fSrcRect.width() >= src.width()) ||
300 (fSrcRect.height() >= src.height())) { 296 (fSrcRect.height() >= src.height())) {
301 return false; 297 return false;
302 } 298 }
303 299
304 SkAutoLockPixels alp(src); 300 SkAutoLockPixels alp(src);
305 SkASSERT(src.getPixels()); 301 SkASSERT(src.getPixels());
306 if (!src.getPixels() || src.width() <= 0 || src.height() <= 0) { 302 if (!src.getPixels() || src.width() <= 0 || src.height() <= 0) {
307 return false; 303 return false;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 356
361 #ifndef SK_IGNORE_TO_STRING 357 #ifndef SK_IGNORE_TO_STRING
362 void SkMagnifierImageFilter::toString(SkString* str) const { 358 void SkMagnifierImageFilter::toString(SkString* str) const {
363 str->appendf("SkMagnifierImageFilter: ("); 359 str->appendf("SkMagnifierImageFilter: (");
364 str->appendf("src: (%f,%f,%f,%f) ", 360 str->appendf("src: (%f,%f,%f,%f) ",
365 fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBotto m); 361 fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBotto m);
366 str->appendf("inset: %f", fInset); 362 str->appendf("inset: %f", fInset);
367 str->append(")"); 363 str->append(")");
368 } 364 }
369 #endif 365 #endif
OLDNEW
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698