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

Side by Side Diff: src/effects/SkColorMatrixFilter.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/SkColorFilters.cpp ('k') | src/effects/SkComposeImageFilter.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
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 #include "SkColorMatrixFilter.h" 8 #include "SkColorMatrixFilter.h"
9 #include "SkColorMatrix.h" 9 #include "SkColorMatrix.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 } 300 }
301 } 301 }
302 302
303 /////////////////////////////////////////////////////////////////////////////// 303 ///////////////////////////////////////////////////////////////////////////////
304 304
305 void SkColorMatrixFilter::flatten(SkWriteBuffer& buffer) const { 305 void SkColorMatrixFilter::flatten(SkWriteBuffer& buffer) const {
306 SkASSERT(sizeof(fMatrix.fMat)/sizeof(SkScalar) == 20); 306 SkASSERT(sizeof(fMatrix.fMat)/sizeof(SkScalar) == 20);
307 buffer.writeScalarArray(fMatrix.fMat, 20); 307 buffer.writeScalarArray(fMatrix.fMat, 20);
308 } 308 }
309 309
310 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
311 SkColorMatrixFilter::SkColorMatrixFilter(SkReadBuffer& buffer) : INHERITED(buffe r) {
312 SkASSERT(buffer.getArrayCount() == 20);
313 if (buffer.readScalarArray(fMatrix.fMat, 20)) {
314 this->initState(fMatrix.fMat);
315 }
316 }
317 #endif
318
310 SkFlattenable* SkColorMatrixFilter::CreateProc(SkReadBuffer& buffer) { 319 SkFlattenable* SkColorMatrixFilter::CreateProc(SkReadBuffer& buffer) {
311 SkColorMatrix matrix; 320 SkColorMatrix matrix;
312 if (buffer.readScalarArray(matrix.fMat, 20)) { 321 if (buffer.readScalarArray(matrix.fMat, 20)) {
313 return Create(matrix); 322 return Create(matrix);
314 } 323 }
315 return NULL; 324 return NULL;
316 } 325 }
317 326
318 bool SkColorMatrixFilter::asColorMatrix(SkScalar matrix[20]) const { 327 bool SkColorMatrixFilter::asColorMatrix(SkScalar matrix[20]) const {
319 if (matrix) { 328 if (matrix) {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 str->append("matrix: ("); 502 str->append("matrix: (");
494 for (int i = 0; i < 20; ++i) { 503 for (int i = 0; i < 20; ++i) {
495 str->appendScalar(fMatrix.fMat[i]); 504 str->appendScalar(fMatrix.fMat[i]);
496 if (i < 19) { 505 if (i < 19) {
497 str->append(", "); 506 str->append(", ");
498 } 507 }
499 } 508 }
500 str->append(")"); 509 str->append(")");
501 } 510 }
502 #endif 511 #endif
OLDNEW
« no previous file with comments | « src/effects/SkColorFilters.cpp ('k') | src/effects/SkComposeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698