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

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

Issue 22799007: I'm investigating how to make the IPC transfer a bit more secure on the (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Windows error fix Created 7 years, 3 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
« no previous file with comments | « src/core/SkFlattenableSerialization.cpp ('k') | src/effects/SkLightingImageFilter.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 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 "SkBicubicImageFilter.h" 8 #include "SkBicubicImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 SkAutoLockPixels alp(src); 93 SkAutoLockPixels alp(src);
94 if (!src.getPixels()) { 94 if (!src.getPixels()) {
95 return false; 95 return false;
96 } 96 }
97 97
98 SkRect dstRect = SkRect::MakeWH(SkScalarMul(SkIntToScalar(src.width()), fSca le.fWidth), 98 SkRect dstRect = SkRect::MakeWH(SkScalarMul(SkIntToScalar(src.width()), fSca le.fWidth),
99 SkScalarMul(SkIntToScalar(src.height()), fSc ale.fHeight)); 99 SkScalarMul(SkIntToScalar(src.height()), fSc ale.fHeight));
100 SkIRect dstIRect; 100 SkIRect dstIRect;
101 dstRect.roundOut(&dstIRect); 101 dstRect.roundOut(&dstIRect);
102 if (dstIRect.isEmpty()) {
103 return false;
104 }
102 result->setConfig(src.config(), dstIRect.width(), dstIRect.height()); 105 result->setConfig(src.config(), dstIRect.width(), dstIRect.height());
103 result->allocPixels(); 106 result->allocPixels();
104 if (!result->getPixels()) { 107 if (!result->getPixels()) {
105 return false; 108 return false;
106 } 109 }
107 110
108 SkRect srcRect; 111 SkRect srcRect;
109 src.getBounds(&srcRect); 112 src.getBounds(&srcRect);
110 SkMatrix inverse; 113 SkMatrix inverse;
111 inverse.setRectToRect(dstRect, srcRect, SkMatrix::kFill_ScaleToFit); 114 inverse.setRectToRect(dstRect, srcRect, SkMatrix::kFill_ScaleToFit);
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 GrPaint paint; 369 GrPaint paint;
367 paint.addColorEffect(GrBicubicEffect::Create(srcTexture, fCoefficients))->un ref(); 370 paint.addColorEffect(GrBicubicEffect::Create(srcTexture, fCoefficients))->un ref();
368 SkRect srcRect; 371 SkRect srcRect;
369 srcBM.getBounds(&srcRect); 372 srcBM.getBounds(&srcRect);
370 context->drawRectToRect(paint, dstRect, srcRect); 373 context->drawRectToRect(paint, dstRect, srcRect);
371 return SkImageFilterUtils::WrapTexture(dst, desc.fWidth, desc.fHeight, resul t); 374 return SkImageFilterUtils::WrapTexture(dst, desc.fWidth, desc.fHeight, resul t);
372 } 375 }
373 #endif 376 #endif
374 377
375 /////////////////////////////////////////////////////////////////////////////// 378 ///////////////////////////////////////////////////////////////////////////////
OLDNEW
« no previous file with comments | « src/core/SkFlattenableSerialization.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698