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

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

Issue 768183002: Revert of Remove SK_SUPPORT_LEGACY_DEEPFLATTENING. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/SkPixelXorXfermode.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 2013 The Android Open Source Project 2 * Copyright 2013 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 "SkPictureImageFilter.h" 8 #include "SkPictureImageFilter.h"
9 #include "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 12 matching lines...) Expand all
23 uint32_t uniqueID) 23 uint32_t uniqueID)
24 : INHERITED(0, 0, NULL, uniqueID) 24 : INHERITED(0, 0, NULL, uniqueID)
25 , fPicture(SkSafeRef(picture)) 25 , fPicture(SkSafeRef(picture))
26 , fCropRect(cropRect) { 26 , fCropRect(cropRect) {
27 } 27 }
28 28
29 SkPictureImageFilter::~SkPictureImageFilter() { 29 SkPictureImageFilter::~SkPictureImageFilter() {
30 SkSafeUnref(fPicture); 30 SkSafeUnref(fPicture);
31 } 31 }
32 32
33 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
34 SkPictureImageFilter::SkPictureImageFilter(SkReadBuffer& buffer)
35 : INHERITED(0, buffer),
36 fPicture(NULL) {
37 if (!buffer.isCrossProcess()) {
38 if (buffer.readBool()) {
39 fPicture = SkPicture::CreateFromBuffer(buffer);
40 }
41 } else {
42 buffer.validate(!buffer.readBool());
43 }
44 buffer.readRect(&fCropRect);
45 }
46 #endif
47
33 SkFlattenable* SkPictureImageFilter::CreateProc(SkReadBuffer& buffer) { 48 SkFlattenable* SkPictureImageFilter::CreateProc(SkReadBuffer& buffer) {
34 SkAutoTUnref<SkPicture> picture; 49 SkAutoTUnref<SkPicture> picture;
35 SkRect cropRect; 50 SkRect cropRect;
36 51
37 if (!buffer.isCrossProcess()) { 52 if (!buffer.isCrossProcess()) {
38 if (buffer.readBool()) { 53 if (buffer.readBool()) {
39 picture.reset(SkPicture::CreateFromBuffer(buffer)); 54 picture.reset(SkPicture::CreateFromBuffer(buffer));
40 } 55 }
41 } else { 56 } else {
42 buffer.validate(!buffer.readBool()); 57 buffer.validate(!buffer.readBool());
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 105
91 canvas.translate(-SkIntToScalar(bounds.fLeft), -SkIntToScalar(bounds.fTop)); 106 canvas.translate(-SkIntToScalar(bounds.fLeft), -SkIntToScalar(bounds.fTop));
92 canvas.concat(ctx.ctm()); 107 canvas.concat(ctx.ctm());
93 canvas.drawPicture(fPicture); 108 canvas.drawPicture(fPicture);
94 109
95 *result = device.get()->accessBitmap(false); 110 *result = device.get()->accessBitmap(false);
96 offset->fX = bounds.fLeft; 111 offset->fX = bounds.fLeft;
97 offset->fY = bounds.fTop; 112 offset->fY = bounds.fTop;
98 return true; 113 return true;
99 } 114 }
OLDNEW
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/SkPixelXorXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698