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

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

Issue 114493005: Fixing valgrind error (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 7 years 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 | « no previous file | 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 "SkBitmapSource.h" 8 #include "SkBitmapSource.h"
9 #include "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 13 matching lines...) Expand all
24 fBitmap(bitmap), 24 fBitmap(bitmap),
25 fSrcRect(srcRect), 25 fSrcRect(srcRect),
26 fDstRect(dstRect) { 26 fDstRect(dstRect) {
27 } 27 }
28 28
29 SkBitmapSource::SkBitmapSource(SkFlattenableReadBuffer& buffer) 29 SkBitmapSource::SkBitmapSource(SkFlattenableReadBuffer& buffer)
30 : INHERITED(0, buffer) { 30 : INHERITED(0, buffer) {
31 fBitmap.unflatten(buffer); 31 fBitmap.unflatten(buffer);
32 buffer.readRect(&fSrcRect); 32 buffer.readRect(&fSrcRect);
33 buffer.readRect(&fDstRect); 33 buffer.readRect(&fDstRect);
34 buffer.validate(SkIsValidRect(fSrcRect) && SkIsValidRect(fDstRect)); 34 buffer.validate(buffer.isValid() && SkIsValidRect(fSrcRect) && SkIsValidRect (fDstRect));
35 } 35 }
36 36
37 void SkBitmapSource::flatten(SkFlattenableWriteBuffer& buffer) const { 37 void SkBitmapSource::flatten(SkFlattenableWriteBuffer& buffer) const {
38 this->INHERITED::flatten(buffer); 38 this->INHERITED::flatten(buffer);
39 fBitmap.flatten(buffer); 39 fBitmap.flatten(buffer);
40 buffer.writeRect(fSrcRect); 40 buffer.writeRect(fSrcRect);
41 buffer.writeRect(fDstRect); 41 buffer.writeRect(fDstRect);
42 } 42 }
43 43
44 bool SkBitmapSource::onFilterImage(Proxy* proxy, const SkBitmap&, const SkMatrix & matrix, 44 bool SkBitmapSource::onFilterImage(Proxy* proxy, const SkBitmap&, const SkMatrix & matrix,
(...skipping 25 matching lines...) Expand all
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698