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

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

Issue 1829093002: Use sk_sp-based APIs for SkColorFilter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to reviews Created 4 years, 8 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
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 "cc/output/gl_renderer.h" 5 #include "cc/output/gl_renderer.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after
1410 matrix[5] = 0.213f - 0.213f * amount; 1410 matrix[5] = 0.213f - 0.213f * amount;
1411 matrix[6] = 0.715f + 0.285f * amount; 1411 matrix[6] = 0.715f + 0.285f * amount;
1412 matrix[7] = 1.f - (matrix[5] + matrix[6]); 1412 matrix[7] = 1.f - (matrix[5] + matrix[6]);
1413 matrix[8] = matrix[9] = 0; 1413 matrix[8] = matrix[9] = 0;
1414 matrix[10] = 0.213f - 0.213f * amount; 1414 matrix[10] = 0.213f - 0.213f * amount;
1415 matrix[11] = 0.715f - 0.715f * amount; 1415 matrix[11] = 0.715f - 0.715f * amount;
1416 matrix[12] = 1.f - (matrix[10] + matrix[11]); 1416 matrix[12] = 1.f - (matrix[10] + matrix[11]);
1417 matrix[13] = matrix[14] = 0; 1417 matrix[13] = matrix[14] = 0;
1418 matrix[15] = matrix[16] = matrix[17] = matrix[19] = 0; 1418 matrix[15] = matrix[16] = matrix[17] = matrix[19] = 0;
1419 matrix[18] = 1; 1419 matrix[18] = 1;
1420 skia::RefPtr<SkColorFilter> color_filter( 1420 sk_sp<SkColorFilter> color_filter =
1421 skia::AdoptRef(SkColorMatrixFilter::Create(matrix))); 1421 SkColorFilter::MakeMatrixFilterRowMajor255(matrix);
1422 skia::RefPtr<SkImageFilter> filter = skia::AdoptRef( 1422 skia::RefPtr<SkImageFilter> filter = skia::AdoptRef(
1423 SkColorFilterImageFilter::Create(color_filter.get(), NULL)); 1423 SkColorFilterImageFilter::Create(color_filter.get(), NULL));
1424 FilterOperations filters; 1424 FilterOperations filters;
1425 filters.Append(FilterOperation::CreateReferenceFilter(filter)); 1425 filters.Append(FilterOperation::CreateReferenceFilter(filter));
1426 1426
1427 gfx::Transform transform_causing_aa; 1427 gfx::Transform transform_causing_aa;
1428 transform_causing_aa.Rotate(20.0); 1428 transform_causing_aa.Rotate(20.0);
1429 1429
1430 for (int i = 0; i <= LAST_BLEND_MODE; ++i) { 1430 for (int i = 0; i <= LAST_BLEND_MODE; ++i) {
1431 BlendMode blend_mode = static_cast<BlendMode>(i); 1431 BlendMode blend_mode = static_cast<BlendMode>(i);
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
2217 EXPECT_CALL(overlay_scheduler, 2217 EXPECT_CALL(overlay_scheduler,
2218 Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect, 2218 Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect,
2219 BoundingRect(uv_top_left, uv_bottom_right))).Times(1); 2219 BoundingRect(uv_top_left, uv_bottom_right))).Times(1);
2220 2220
2221 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_rect, 2221 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_rect,
2222 viewport_rect, false); 2222 viewport_rect, false);
2223 } 2223 }
2224 2224
2225 } // namespace 2225 } // namespace
2226 } // namespace cc 2226 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698