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

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

Issue 230653005: Implement intra-frame cacheing in image filters. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Set minChildren to 2 by default; comment it. Created 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
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 "SkTileImageFilter.h" 8 #include "SkTileImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
11 #include "SkDevice.h" 11 #include "SkDevice.h"
12 #include "SkReadBuffer.h" 12 #include "SkReadBuffer.h"
13 #include "SkWriteBuffer.h" 13 #include "SkWriteBuffer.h"
14 #include "SkMatrix.h" 14 #include "SkMatrix.h"
15 #include "SkPaint.h" 15 #include "SkPaint.h"
16 #include "SkShader.h" 16 #include "SkShader.h"
17 #include "SkValidationUtils.h" 17 #include "SkValidationUtils.h"
18 18
19 bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, const S kImageFilter::Context& ctx, 19 bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
20 const Context& ctx,
20 SkBitmap* dst, SkIPoint* offset) const { 21 SkBitmap* dst, SkIPoint* offset) const {
21 SkBitmap source = src; 22 SkBitmap source = src;
22 SkImageFilter* input = getInput(0); 23 SkImageFilter* input = getInput(0);
23 SkIPoint srcOffset = SkIPoint::Make(0, 0); 24 SkIPoint srcOffset = SkIPoint::Make(0, 0);
24 if (input && !input->filterImage(proxy, src, ctx, &source, &srcOffset)) { 25 if (input && !input->filterImage(proxy, src, ctx, &source, &srcOffset)) {
25 return false; 26 return false;
26 } 27 }
27 28
28 SkRect dstRect; 29 SkRect dstRect;
29 ctx.ctm().mapRect(&dstRect, fDstRect); 30 ctx.ctm().mapRect(&dstRect, fDstRect);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 buffer.readRect(&fSrcRect); 80 buffer.readRect(&fSrcRect);
80 buffer.readRect(&fDstRect); 81 buffer.readRect(&fDstRect);
81 buffer.validate(buffer.isValid() && SkIsValidRect(fSrcRect) && SkIsValidRect (fDstRect)); 82 buffer.validate(buffer.isValid() && SkIsValidRect(fSrcRect) && SkIsValidRect (fDstRect));
82 } 83 }
83 84
84 void SkTileImageFilter::flatten(SkWriteBuffer& buffer) const { 85 void SkTileImageFilter::flatten(SkWriteBuffer& buffer) const {
85 this->INHERITED::flatten(buffer); 86 this->INHERITED::flatten(buffer);
86 buffer.writeRect(fSrcRect); 87 buffer.writeRect(fSrcRect);
87 buffer.writeRect(fDstRect); 88 buffer.writeRect(fDstRect);
88 } 89 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698