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

Side by Side Diff: src/gpu/GrOvalRenderer.cpp

Issue 2267953002: Fix CircleBatch::TestCreate to always use a legal matrix (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 3 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrOvalRenderer.h" 8 #include "GrOvalRenderer.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 1900 matching lines...) Expand 10 before | Expand all | Expand 10 after
1911 }; 1911 };
1912 return CircleBatch::Create(color, viewMatrix, center, width/2.f, style, &arc Params); 1912 return CircleBatch::Create(color, viewMatrix, center, width/2.f, style, &arc Params);
1913 } 1913 }
1914 1914
1915 /////////////////////////////////////////////////////////////////////////////// 1915 ///////////////////////////////////////////////////////////////////////////////
1916 1916
1917 #ifdef GR_TEST_UTILS 1917 #ifdef GR_TEST_UTILS
1918 1918
1919 DRAW_BATCH_TEST_DEFINE(CircleBatch) { 1919 DRAW_BATCH_TEST_DEFINE(CircleBatch) {
1920 do { 1920 do {
1921 SkMatrix viewMatrix = GrTest::TestMatrix(random); 1921 SkScalar rotate = random->nextSScalar1() * 360.f;
1922 SkScalar translateX = random->nextSScalar1() * 1000.f;
1923 SkScalar translateY = random->nextSScalar1() * 1000.f;
1924 SkScalar scale = random->nextSScalar1() * 100.f;
1925 SkMatrix viewMatrix;
1926 viewMatrix.setRotate(rotate);
1927 viewMatrix.postTranslate(translateX, translateY);
1928 viewMatrix.postScale(scale, scale);
1922 GrColor color = GrRandomColor(random); 1929 GrColor color = GrRandomColor(random);
1923 SkRect circle = GrTest::TestSquare(random); 1930 SkRect circle = GrTest::TestSquare(random);
1924 SkPoint center = {circle.centerX(), circle.centerY()}; 1931 SkPoint center = {circle.centerX(), circle.centerY()};
1925 SkScalar radius = circle.width() / 2.f; 1932 SkScalar radius = circle.width() / 2.f;
1926 SkStrokeRec stroke = GrTest::TestStrokeRec(random); 1933 SkStrokeRec stroke = GrTest::TestStrokeRec(random);
1927 CircleBatch::ArcParams arcParamsTmp; 1934 CircleBatch::ArcParams arcParamsTmp;
1928 const CircleBatch::ArcParams* arcParams = nullptr; 1935 const CircleBatch::ArcParams* arcParams = nullptr;
1929 if (random->nextBool()) { 1936 if (random->nextBool()) {
1930 arcParamsTmp.fStartAngleRadians = random->nextSScalar1() * SK_Scalar PI * 2; 1937 arcParamsTmp.fStartAngleRadians = random->nextSScalar1() * SK_Scalar PI * 2;
1931 arcParamsTmp.fStartAngleRadians = random->nextSScalar1() * SK_Scalar PI * 2 - .01f; 1938 arcParamsTmp.fStartAngleRadians = random->nextSScalar1() * SK_Scalar PI * 2 - .01f;
(...skipping 22 matching lines...) Expand all
1954 } 1961 }
1955 1962
1956 DRAW_BATCH_TEST_DEFINE(RRectBatch) { 1963 DRAW_BATCH_TEST_DEFINE(RRectBatch) {
1957 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); 1964 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random);
1958 GrColor color = GrRandomColor(random); 1965 GrColor color = GrRandomColor(random);
1959 const SkRRect& rrect = GrTest::TestRRectSimple(random); 1966 const SkRRect& rrect = GrTest::TestRRectSimple(random);
1960 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra ndom)); 1967 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra ndom));
1961 } 1968 }
1962 1969
1963 #endif 1970 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698