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

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

Issue 1869753003: Replace many skia::RefPtr with sk_sp<> in cc/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Florin's nits Created 4 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
« no previous file with comments | « cc/output/render_surface_filters.cc ('k') | cc/output/software_renderer.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 // 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "cc/output/gl_renderer.h" 10 #include "cc/output/gl_renderer.h"
(...skipping 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 matrix[5] = 0.213f - 0.213f * amount; 1384 matrix[5] = 0.213f - 0.213f * amount;
1385 matrix[6] = 0.715f + 0.285f * amount; 1385 matrix[6] = 0.715f + 0.285f * amount;
1386 matrix[7] = 1.f - (matrix[5] + matrix[6]); 1386 matrix[7] = 1.f - (matrix[5] + matrix[6]);
1387 matrix[8] = matrix[9] = 0; 1387 matrix[8] = matrix[9] = 0;
1388 matrix[10] = 0.213f - 0.213f * amount; 1388 matrix[10] = 0.213f - 0.213f * amount;
1389 matrix[11] = 0.715f - 0.715f * amount; 1389 matrix[11] = 0.715f - 0.715f * amount;
1390 matrix[12] = 1.f - (matrix[10] + matrix[11]); 1390 matrix[12] = 1.f - (matrix[10] + matrix[11]);
1391 matrix[13] = matrix[14] = 0; 1391 matrix[13] = matrix[14] = 0;
1392 matrix[15] = matrix[16] = matrix[17] = matrix[19] = 0; 1392 matrix[15] = matrix[16] = matrix[17] = matrix[19] = 0;
1393 matrix[18] = 1; 1393 matrix[18] = 1;
1394 sk_sp<SkColorFilter> color_filter =
1395 SkColorFilter::MakeMatrixFilterRowMajor255(matrix);
1396 skia::RefPtr<SkImageFilter> filter = skia::AdoptRef(
1397 SkColorFilterImageFilter::Create(color_filter.get(), NULL));
1398 FilterOperations filters; 1394 FilterOperations filters;
1399 filters.Append(FilterOperation::CreateReferenceFilter(filter)); 1395 filters.Append(
1396 FilterOperation::CreateReferenceFilter(SkColorFilterImageFilter::Make(
1397 SkColorFilter::MakeMatrixFilterRowMajor255(matrix), nullptr)));
1400 1398
1401 RenderPassDrawQuad* render_pass_quad = 1399 RenderPassDrawQuad* render_pass_quad =
1402 root_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); 1400 root_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
1403 render_pass_quad->SetNew(pass_shared_state, 1401 render_pass_quad->SetNew(pass_shared_state,
1404 pass_rect, 1402 pass_rect,
1405 pass_rect, 1403 pass_rect,
1406 child_pass_id, 1404 child_pass_id,
1407 0, 1405 0,
1408 gfx::Vector2dF(), 1406 gfx::Vector2dF(),
1409 gfx::Size(), 1407 gfx::Size(),
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1623 matrix[7] = 1.f - (matrix[5] + matrix[6]); 1621 matrix[7] = 1.f - (matrix[5] + matrix[6]);
1624 matrix[8] = 0; 1622 matrix[8] = 0;
1625 matrix[9] = 200.f; 1623 matrix[9] = 200.f;
1626 matrix[10] = 0.213f - 0.213f * amount; 1624 matrix[10] = 0.213f - 0.213f * amount;
1627 matrix[11] = 0.715f - 0.715f * amount; 1625 matrix[11] = 0.715f - 0.715f * amount;
1628 matrix[12] = 1.f - (matrix[10] + matrix[11]); 1626 matrix[12] = 1.f - (matrix[10] + matrix[11]);
1629 matrix[13] = 0; 1627 matrix[13] = 0;
1630 matrix[14] = 1.5f; 1628 matrix[14] = 1.5f;
1631 matrix[15] = matrix[16] = matrix[17] = matrix[19] = 0; 1629 matrix[15] = matrix[16] = matrix[17] = matrix[19] = 0;
1632 matrix[18] = 1; 1630 matrix[18] = 1;
1633 sk_sp<SkColorFilter> color_filter =
1634 SkColorFilter::MakeMatrixFilterRowMajor255(matrix);
1635 skia::RefPtr<SkImageFilter> filter = skia::AdoptRef(
1636 SkColorFilterImageFilter::Create(color_filter.get(), NULL));
1637 FilterOperations filters; 1631 FilterOperations filters;
1638 filters.Append(FilterOperation::CreateReferenceFilter(filter)); 1632 filters.Append(
1633 FilterOperation::CreateReferenceFilter(SkColorFilterImageFilter::Make(
1634 SkColorFilter::MakeMatrixFilterRowMajor255(matrix), nullptr)));
1639 1635
1640 RenderPassDrawQuad* render_pass_quad = 1636 RenderPassDrawQuad* render_pass_quad =
1641 root_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); 1637 root_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
1642 render_pass_quad->SetNew(pass_shared_state, 1638 render_pass_quad->SetNew(pass_shared_state,
1643 pass_rect, 1639 pass_rect,
1644 pass_rect, 1640 pass_rect,
1645 child_pass_id, 1641 child_pass_id,
1646 0, 1642 0,
1647 gfx::Vector2dF(), 1643 gfx::Vector2dF(),
1648 gfx::Size(), 1644 gfx::Size(),
(...skipping 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after
3178 3174
3179 EXPECT_TRUE(this->RunPixelTest( 3175 EXPECT_TRUE(this->RunPixelTest(
3180 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), 3176 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")),
3181 FuzzyPixelOffByOneComparator(true))); 3177 FuzzyPixelOffByOneComparator(true)));
3182 } 3178 }
3183 3179
3184 #endif // !defined(OS_ANDROID) 3180 #endif // !defined(OS_ANDROID)
3185 3181
3186 } // namespace 3182 } // namespace
3187 } // namespace cc 3183 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/render_surface_filters.cc ('k') | cc/output/software_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698