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

Side by Side Diff: src/core/SkComposeShader.cpp

Issue 769953002: 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/core/SkBlitter.cpp ('k') | src/core/SkEmptyShader.h » ('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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkComposeShader.h" 10 #include "SkComposeShader.h"
11 #include "SkColorFilter.h" 11 #include "SkColorFilter.h"
12 #include "SkColorPriv.h" 12 #include "SkColorPriv.h"
13 #include "SkColorShader.h" 13 #include "SkColorShader.h"
14 #include "SkReadBuffer.h" 14 #include "SkReadBuffer.h"
15 #include "SkWriteBuffer.h" 15 #include "SkWriteBuffer.h"
16 #include "SkXfermode.h" 16 #include "SkXfermode.h"
17 #include "SkString.h" 17 #include "SkString.h"
18 18
19 /////////////////////////////////////////////////////////////////////////////// 19 ///////////////////////////////////////////////////////////////////////////////
20 20
21 SkComposeShader::SkComposeShader(SkShader* sA, SkShader* sB, SkXfermode* mode) { 21 SkComposeShader::SkComposeShader(SkShader* sA, SkShader* sB, SkXfermode* mode) {
22 fShaderA = sA; sA->ref(); 22 fShaderA = sA; sA->ref();
23 fShaderB = sB; sB->ref(); 23 fShaderB = sB; sB->ref();
24 // mode may be null 24 // mode may be null
25 fMode = mode; 25 fMode = mode;
26 SkSafeRef(mode); 26 SkSafeRef(mode);
27 } 27 }
28 28
29 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
30 SkComposeShader::SkComposeShader(SkReadBuffer& buffer) : INHERITED(buffer) {
31 fShaderA = buffer.readShader();
32 if (NULL == fShaderA) {
33 fShaderA = SkNEW_ARGS(SkColorShader, ((SkColor)0));
34 }
35 fShaderB = buffer.readShader();
36 if (NULL == fShaderB) {
37 fShaderB = SkNEW_ARGS(SkColorShader, ((SkColor)0));
38 }
39 fMode = buffer.readXfermode();
40 }
41 #endif
42
43 SkComposeShader::~SkComposeShader() { 29 SkComposeShader::~SkComposeShader() {
44 SkSafeUnref(fMode); 30 SkSafeUnref(fMode);
45 fShaderB->unref(); 31 fShaderB->unref();
46 fShaderA->unref(); 32 fShaderA->unref();
47 } 33 }
48 34
49 size_t SkComposeShader::contextSize() const { 35 size_t SkComposeShader::contextSize() const {
50 return sizeof(ComposeShaderContext) + fShaderA->contextSize() + fShaderB->co ntextSize(); 36 return sizeof(ComposeShaderContext) + fShaderA->contextSize() + fShaderB->co ntextSize();
51 } 37 }
52 38
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 str->append(" ShaderB: "); 203 str->append(" ShaderB: ");
218 fShaderB->toString(str); 204 fShaderB->toString(str);
219 str->append(" Xfermode: "); 205 str->append(" Xfermode: ");
220 fMode->toString(str); 206 fMode->toString(str);
221 207
222 this->INHERITED::toString(str); 208 this->INHERITED::toString(str);
223 209
224 str->append(")"); 210 str->append(")");
225 } 211 }
226 #endif 212 #endif
OLDNEW
« no previous file with comments | « src/core/SkBlitter.cpp ('k') | src/core/SkEmptyShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698