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

Side by Side Diff: cc/output/renderer_pixeltest.cc

Issue 271073002: Use factory methods for Skia effects in unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months 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 | Annotate | Revision Log
« no previous file with comments | « cc/output/gl_renderer_unittest.cc ('k') | cc/trees/damage_tracker_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
6 #include "cc/layers/append_quads_data.h" 6 #include "cc/layers/append_quads_data.h"
7 #include "cc/output/gl_renderer.h" 7 #include "cc/output/gl_renderer.h"
8 #include "cc/quads/draw_quad.h" 8 #include "cc/quads/draw_quad.h"
9 #include "cc/quads/picture_draw_quad.h" 9 #include "cc/quads/picture_draw_quad.h"
10 #include "cc/quads/texture_draw_quad.h" 10 #include "cc/quads/texture_draw_quad.h"
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 matrix[5] = 0.213f - 0.213f * amount; 805 matrix[5] = 0.213f - 0.213f * amount;
806 matrix[6] = 0.715f + 0.285f * amount; 806 matrix[6] = 0.715f + 0.285f * amount;
807 matrix[7] = 1.f - (matrix[5] + matrix[6]); 807 matrix[7] = 1.f - (matrix[5] + matrix[6]);
808 matrix[8] = matrix[9] = 0; 808 matrix[8] = matrix[9] = 0;
809 matrix[10] = 0.213f - 0.213f * amount; 809 matrix[10] = 0.213f - 0.213f * amount;
810 matrix[11] = 0.715f - 0.715f * amount; 810 matrix[11] = 0.715f - 0.715f * amount;
811 matrix[12] = 1.f - (matrix[10] + matrix[11]); 811 matrix[12] = 1.f - (matrix[10] + matrix[11]);
812 matrix[13] = matrix[14] = 0; 812 matrix[13] = matrix[14] = 0;
813 matrix[15] = matrix[16] = matrix[17] = matrix[19] = 0; 813 matrix[15] = matrix[16] = matrix[17] = matrix[19] = 0;
814 matrix[18] = 1; 814 matrix[18] = 1;
815 skia::RefPtr<SkColorFilter> colorFilter(skia::AdoptRef( 815 skia::RefPtr<SkColorFilter> colorFilter(
816 new SkColorMatrixFilter(matrix))); 816 skia::AdoptRef(SkColorMatrixFilter::Create(matrix)));
817 skia::RefPtr<SkImageFilter> filter = 817 skia::RefPtr<SkImageFilter> filter =
818 skia::AdoptRef(SkColorFilterImageFilter::Create(colorFilter.get(), NULL)); 818 skia::AdoptRef(SkColorFilterImageFilter::Create(colorFilter.get(), NULL));
819 FilterOperations filters; 819 FilterOperations filters;
820 filters.Append(FilterOperation::CreateReferenceFilter(filter)); 820 filters.Append(FilterOperation::CreateReferenceFilter(filter));
821 821
822 scoped_ptr<RenderPassDrawQuad> render_pass_quad = 822 scoped_ptr<RenderPassDrawQuad> render_pass_quad =
823 RenderPassDrawQuad::Create(); 823 RenderPassDrawQuad::Create();
824 render_pass_quad->SetNew(pass_shared_state, 824 render_pass_quad->SetNew(pass_shared_state,
825 pass_rect, 825 pass_rect,
826 pass_rect, 826 pass_rect,
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 matrix[7] = 1.f - (matrix[5] + matrix[6]); 1050 matrix[7] = 1.f - (matrix[5] + matrix[6]);
1051 matrix[8] = 0; 1051 matrix[8] = 0;
1052 matrix[9] = 200.f; 1052 matrix[9] = 200.f;
1053 matrix[10] = 0.213f - 0.213f * amount; 1053 matrix[10] = 0.213f - 0.213f * amount;
1054 matrix[11] = 0.715f - 0.715f * amount; 1054 matrix[11] = 0.715f - 0.715f * amount;
1055 matrix[12] = 1.f - (matrix[10] + matrix[11]); 1055 matrix[12] = 1.f - (matrix[10] + matrix[11]);
1056 matrix[13] = 0; 1056 matrix[13] = 0;
1057 matrix[14] = 1.5f; 1057 matrix[14] = 1.5f;
1058 matrix[15] = matrix[16] = matrix[17] = matrix[19] = 0; 1058 matrix[15] = matrix[16] = matrix[17] = matrix[19] = 0;
1059 matrix[18] = 1; 1059 matrix[18] = 1;
1060 skia::RefPtr<SkColorFilter> colorFilter(skia::AdoptRef( 1060 skia::RefPtr<SkColorFilter> colorFilter(
1061 new SkColorMatrixFilter(matrix))); 1061 skia::AdoptRef(SkColorMatrixFilter::Create(matrix)));
1062 skia::RefPtr<SkImageFilter> filter = 1062 skia::RefPtr<SkImageFilter> filter =
1063 skia::AdoptRef(SkColorFilterImageFilter::Create(colorFilter.get(), NULL)); 1063 skia::AdoptRef(SkColorFilterImageFilter::Create(colorFilter.get(), NULL));
1064 FilterOperations filters; 1064 FilterOperations filters;
1065 filters.Append(FilterOperation::CreateReferenceFilter(filter)); 1065 filters.Append(FilterOperation::CreateReferenceFilter(filter));
1066 1066
1067 scoped_ptr<RenderPassDrawQuad> render_pass_quad = 1067 scoped_ptr<RenderPassDrawQuad> render_pass_quad =
1068 RenderPassDrawQuad::Create(); 1068 RenderPassDrawQuad::Create();
1069 render_pass_quad->SetNew(pass_shared_state, 1069 render_pass_quad->SetNew(pass_shared_state,
1070 pass_rect, 1070 pass_rect,
1071 pass_rect, 1071 pass_rect,
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
2221 EXPECT_TRUE(this->RunPixelTest( 2221 EXPECT_TRUE(this->RunPixelTest(
2222 &pass_list, 2222 &pass_list,
2223 base::FilePath(FILE_PATH_LITERAL("wrap_mode_repeat.png")), 2223 base::FilePath(FILE_PATH_LITERAL("wrap_mode_repeat.png")),
2224 FuzzyPixelOffByOneComparator(true))); 2224 FuzzyPixelOffByOneComparator(true)));
2225 } 2225 }
2226 2226
2227 #endif // !defined(OS_ANDROID) 2227 #endif // !defined(OS_ANDROID)
2228 2228
2229 } // namespace 2229 } // namespace
2230 } // namespace cc 2230 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/gl_renderer_unittest.cc ('k') | cc/trees/damage_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698