OLD | NEW |
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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 } | 325 } |
326 | 326 |
327 bool SkColorMatrixFilter::asColorMatrix(SkScalar matrix[20]) const { | 327 bool SkColorMatrixFilter::asColorMatrix(SkScalar matrix[20]) const { |
328 if (matrix) { | 328 if (matrix) { |
329 memcpy(matrix, fMatrix.fMat, 20 * sizeof(SkScalar)); | 329 memcpy(matrix, fMatrix.fMat, 20 * sizeof(SkScalar)); |
330 } | 330 } |
331 return true; | 331 return true; |
332 } | 332 } |
333 | 333 |
334 #if SK_SUPPORT_GPU | 334 #if SK_SUPPORT_GPU |
335 #include "GrProcessor.h" | 335 #include "GrFragmentProcessor.h" |
336 #include "GrTBackendProcessorFactory.h" | 336 #include "GrTBackendProcessorFactory.h" |
337 #include "gl/GrGLProcessor.h" | 337 #include "gl/GrGLProcessor.h" |
338 #include "gl/builders/GrGLProgramBuilder.h" | 338 #include "gl/builders/GrGLProgramBuilder.h" |
339 | 339 |
340 class ColorMatrixEffect : public GrFragmentProcessor { | 340 class ColorMatrixEffect : public GrFragmentProcessor { |
341 public: | 341 public: |
342 static GrFragmentProcessor* Create(const SkColorMatrix& matrix) { | 342 static GrFragmentProcessor* Create(const SkColorMatrix& matrix) { |
343 return SkNEW_ARGS(ColorMatrixEffect, (matrix)); | 343 return SkNEW_ARGS(ColorMatrixEffect, (matrix)); |
344 } | 344 } |
345 | 345 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 str->append("matrix: ("); | 501 str->append("matrix: ("); |
502 for (int i = 0; i < 20; ++i) { | 502 for (int i = 0; i < 20; ++i) { |
503 str->appendScalar(fMatrix.fMat[i]); | 503 str->appendScalar(fMatrix.fMat[i]); |
504 if (i < 19) { | 504 if (i < 19) { |
505 str->append(", "); | 505 str->append(", "); |
506 } | 506 } |
507 } | 507 } |
508 str->append(")"); | 508 str->append(")"); |
509 } | 509 } |
510 #endif | 510 #endif |
OLD | NEW |