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

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

Issue 770703002: Bump min picture version. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: TODO Created 6 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 | « src/core/SkShader.cpp ('k') | src/effects/SkDashPathEffect.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 10 matching lines...) Expand all
21 {} 21 {}
22 22
23 SkBitmapSource::SkBitmapSource(const SkBitmap& bitmap, const SkRect& srcRect, co nst SkRect& dstRect) 23 SkBitmapSource::SkBitmapSource(const SkBitmap& bitmap, const SkRect& srcRect, co nst SkRect& dstRect)
24 : INHERITED(0, 0) 24 : INHERITED(0, 0)
25 , fBitmap(bitmap) 25 , fBitmap(bitmap)
26 , fSrcRect(srcRect) 26 , fSrcRect(srcRect)
27 , fDstRect(dstRect) {} 27 , fDstRect(dstRect) {}
28 28
29 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING 29 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
30 SkBitmapSource::SkBitmapSource(SkReadBuffer& buffer) : INHERITED(0, buffer) { 30 SkBitmapSource::SkBitmapSource(SkReadBuffer& buffer) : INHERITED(0, buffer) {
31 if (buffer.isVersionLT(SkReadBuffer::kNoMoreBitmapFlatten_Version)) { 31 buffer.readBitmap(&fBitmap);
32 fBitmap.legacyUnflatten(buffer);
33 } else {
34 buffer.readBitmap(&fBitmap);
35 }
36 buffer.readRect(&fSrcRect); 32 buffer.readRect(&fSrcRect);
37 buffer.readRect(&fDstRect); 33 buffer.readRect(&fDstRect);
38 buffer.validate(buffer.isValid() && SkIsValidRect(fSrcRect) && SkIsValidRect (fDstRect)); 34 buffer.validate(buffer.isValid() && SkIsValidRect(fSrcRect) && SkIsValidRect (fDstRect));
39 } 35 }
40 #endif 36 #endif
41 37
42 SkFlattenable* SkBitmapSource::CreateProc(SkReadBuffer& buffer) { 38 SkFlattenable* SkBitmapSource::CreateProc(SkReadBuffer& buffer) {
43 SkRect src, dst; 39 SkRect src, dst;
44 buffer.readRect(&src); 40 buffer.readRect(&src);
45 buffer.readRect(&dst); 41 buffer.readRect(&dst);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 85
90 *result = device.get()->accessBitmap(false); 86 *result = device.get()->accessBitmap(false);
91 offset->fX = dstIRect.fLeft; 87 offset->fX = dstIRect.fLeft;
92 offset->fY = dstIRect.fTop; 88 offset->fY = dstIRect.fTop;
93 return true; 89 return true;
94 } 90 }
95 91
96 void SkBitmapSource::computeFastBounds(const SkRect&, SkRect* dst) const { 92 void SkBitmapSource::computeFastBounds(const SkRect&, SkRect* dst) const {
97 *dst = fDstRect; 93 *dst = fDstRect;
98 } 94 }
OLDNEW
« no previous file with comments | « src/core/SkShader.cpp ('k') | src/effects/SkDashPathEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698