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

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

Issue 112803004: Make SkImageFilter crop rects relative to the primitive origin, instead of relative to their parent (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Remove a useless zero. Created 6 years, 11 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 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 "SkBitmapSource.h" 8 #include "SkBitmapSource.h"
9 #include "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 dstRect.offset(-SkIntToScalar(dstIRect.fLeft), -SkIntToScalar(dstIRect.fTop) ); 66 dstRect.offset(-SkIntToScalar(dstIRect.fLeft), -SkIntToScalar(dstIRect.fTop) );
67 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 67 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
68 // FIXME: this probably shouldn't be necessary, but drawBitmapRectToRect ass erts 68 // FIXME: this probably shouldn't be necessary, but drawBitmapRectToRect ass erts
69 // None filtering when it's translate-only 69 // None filtering when it's translate-only
70 paint.setFilterLevel( 70 paint.setFilterLevel(
71 fSrcRect.width() == dstRect.width() && fSrcRect.height() == dstRect.heig ht() ? 71 fSrcRect.width() == dstRect.width() && fSrcRect.height() == dstRect.heig ht() ?
72 SkPaint::kNone_FilterLevel : SkPaint::kMedium_FilterLevel); 72 SkPaint::kNone_FilterLevel : SkPaint::kMedium_FilterLevel);
73 canvas.drawBitmapRectToRect(fBitmap, &fSrcRect, dstRect, &paint); 73 canvas.drawBitmapRectToRect(fBitmap, &fSrcRect, dstRect, &paint);
74 74
75 *result = device.get()->accessBitmap(false); 75 *result = device.get()->accessBitmap(false);
76 offset->fX += dstIRect.fLeft; 76 offset->fX = dstIRect.fLeft;
77 offset->fY += dstIRect.fTop; 77 offset->fY = dstIRect.fTop;
78 return true; 78 return true;
79 } 79 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698