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

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 review 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "cc/output/gl_renderer.h" 9 #include "cc/output/gl_renderer.h"
10 #include "cc/quads/draw_quad.h" 10 #include "cc/quads/draw_quad.h"
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 matrix[5] = 0.213f - 0.213f * amount; 1383 matrix[5] = 0.213f - 0.213f * amount;
1384 matrix[6] = 0.715f + 0.285f * amount; 1384 matrix[6] = 0.715f + 0.285f * amount;
1385 matrix[7] = 1.f - (matrix[5] + matrix[6]); 1385 matrix[7] = 1.f - (matrix[5] + matrix[6]);
1386 matrix[8] = matrix[9] = 0; 1386 matrix[8] = matrix[9] = 0;
1387 matrix[10] = 0.213f - 0.213f * amount; 1387 matrix[10] = 0.213f - 0.213f * amount;
1388 matrix[11] = 0.715f - 0.715f * amount; 1388 matrix[11] = 0.715f - 0.715f * amount;
1389 matrix[12] = 1.f - (matrix[10] + matrix[11]); 1389 matrix[12] = 1.f - (matrix[10] + matrix[11]);
1390 matrix[13] = matrix[14] = 0; 1390 matrix[13] = matrix[14] = 0;
1391 matrix[15] = matrix[16] = matrix[17] = matrix[19] = 0; 1391 matrix[15] = matrix[16] = matrix[17] = matrix[19] = 0;
1392 matrix[18] = 1; 1392 matrix[18] = 1;
1393 sk_sp<SkColorFilter> color_filter =
1394 SkColorFilter::MakeMatrixFilterRowMajor255(matrix);
1395 skia::RefPtr<SkImageFilter> filter = skia::AdoptRef(
1396 SkColorFilterImageFilter::Create(color_filter.get(), NULL));
1397 FilterOperations filters; 1393 FilterOperations filters;
1398 filters.Append(FilterOperation::CreateReferenceFilter(filter)); 1394 filters.Append(
1395 FilterOperation::CreateReferenceFilter(SkColorFilterImageFilter::Make(
1396 SkColorFilter::MakeMatrixFilterRowMajor255(matrix), NULL)));
danakj 2016/04/25 22:06:23 nit: nullptr
tomhudson 2016/04/27 12:06:47 Done.
1399 1397
1400 RenderPassDrawQuad* render_pass_quad = 1398 RenderPassDrawQuad* render_pass_quad =
1401 root_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); 1399 root_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
1402 render_pass_quad->SetNew(pass_shared_state, 1400 render_pass_quad->SetNew(pass_shared_state,
1403 pass_rect, 1401 pass_rect,
1404 pass_rect, 1402 pass_rect,
1405 child_pass_id, 1403 child_pass_id,
1406 0, 1404 0,
1407 gfx::Vector2dF(), 1405 gfx::Vector2dF(),
1408 gfx::Size(), 1406 gfx::Size(),
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1622 matrix[7] = 1.f - (matrix[5] + matrix[6]); 1620 matrix[7] = 1.f - (matrix[5] + matrix[6]);
1623 matrix[8] = 0; 1621 matrix[8] = 0;
1624 matrix[9] = 200.f; 1622 matrix[9] = 200.f;
1625 matrix[10] = 0.213f - 0.213f * amount; 1623 matrix[10] = 0.213f - 0.213f * amount;
1626 matrix[11] = 0.715f - 0.715f * amount; 1624 matrix[11] = 0.715f - 0.715f * amount;
1627 matrix[12] = 1.f - (matrix[10] + matrix[11]); 1625 matrix[12] = 1.f - (matrix[10] + matrix[11]);
1628 matrix[13] = 0; 1626 matrix[13] = 0;
1629 matrix[14] = 1.5f; 1627 matrix[14] = 1.5f;
1630 matrix[15] = matrix[16] = matrix[17] = matrix[19] = 0; 1628 matrix[15] = matrix[16] = matrix[17] = matrix[19] = 0;
1631 matrix[18] = 1; 1629 matrix[18] = 1;
1632 sk_sp<SkColorFilter> color_filter =
1633 SkColorFilter::MakeMatrixFilterRowMajor255(matrix);
1634 skia::RefPtr<SkImageFilter> filter = skia::AdoptRef(
1635 SkColorFilterImageFilter::Create(color_filter.get(), NULL));
1636 FilterOperations filters; 1630 FilterOperations filters;
1637 filters.Append(FilterOperation::CreateReferenceFilter(filter)); 1631 filters.Append(
1632 FilterOperation::CreateReferenceFilter(SkColorFilterImageFilter::Make(
1633 SkColorFilter::MakeMatrixFilterRowMajor255(matrix), NULL)));
danakj 2016/04/25 22:06:23 nit: nullptr
tomhudson 2016/04/27 12:06:47 Done.
1638 1634
1639 RenderPassDrawQuad* render_pass_quad = 1635 RenderPassDrawQuad* render_pass_quad =
1640 root_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); 1636 root_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
1641 render_pass_quad->SetNew(pass_shared_state, 1637 render_pass_quad->SetNew(pass_shared_state,
1642 pass_rect, 1638 pass_rect,
1643 pass_rect, 1639 pass_rect,
1644 child_pass_id, 1640 child_pass_id,
1645 0, 1641 0,
1646 gfx::Vector2dF(), 1642 gfx::Vector2dF(),
1647 gfx::Size(), 1643 gfx::Size(),
(...skipping 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after
3177 3173
3178 EXPECT_TRUE(this->RunPixelTest( 3174 EXPECT_TRUE(this->RunPixelTest(
3179 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), 3175 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")),
3180 FuzzyPixelOffByOneComparator(true))); 3176 FuzzyPixelOffByOneComparator(true)));
3181 } 3177 }
3182 3178
3183 #endif // !defined(OS_ANDROID) 3179 #endif // !defined(OS_ANDROID)
3184 3180
3185 } // namespace 3181 } // namespace
3186 } // namespace cc 3182 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698