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/SkBitmapSource.cpp

Issue 137423005: Implement a computeFastBounds() traversal for SkImageFilter. This allows for correct culling of pri… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix Win build; update to ToT Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/effects/SkBlurImageFilter.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 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 paint.setFilterLevel( 71 paint.setFilterLevel(
72 fSrcRect.width() == dstRect.width() && fSrcRect.height() == dstRect.heig ht() ? 72 fSrcRect.width() == dstRect.width() && fSrcRect.height() == dstRect.heig ht() ?
73 SkPaint::kNone_FilterLevel : SkPaint::kMedium_FilterLevel); 73 SkPaint::kNone_FilterLevel : SkPaint::kMedium_FilterLevel);
74 canvas.drawBitmapRectToRect(fBitmap, &fSrcRect, dstRect, &paint); 74 canvas.drawBitmapRectToRect(fBitmap, &fSrcRect, dstRect, &paint);
75 75
76 *result = device.get()->accessBitmap(false); 76 *result = device.get()->accessBitmap(false);
77 offset->fX = dstIRect.fLeft; 77 offset->fX = dstIRect.fLeft;
78 offset->fY = dstIRect.fTop; 78 offset->fY = dstIRect.fTop;
79 return true; 79 return true;
80 } 80 }
81
82 void SkBitmapSource::computeFastBounds(const SkRect&, SkRect* dst) const {
83 *dst = fDstRect;
84 }
OLDNEW
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/effects/SkBlurImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698