aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar benjaminwagner <benjaminwagner@google.com>2016-02-24 06:51:52 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-24 06:51:52 -0800
commit7ea5cb18389db11a94175de95c9db2b44972630c (patch)
tree3e87b6ec8c453081a1666fca96dfb5bfbbda2141 /samplecode
parent8f7b0b2d809510d4af4e6ff6f731bac78eded6c4 (diff)
Cleanups related to SkFixed.
Remove SK_FixedNaN. It does not seem to be supported or used anywhere in Skia, Chromium, Android, or Google3, (except accidentally by TwoPtRadial::kDontDrawT). I think supporting it would erase any benefit of SkFixed over float. Remove SkBitmapFilter::lookup. It does not appear to be used anywhere in Skia, Chromium, Android, or Google3. Fix a bug in SkPaint::breakText that limited it to ~5kB of text. Now it can handle more than 1GB. BUG=skia:4632 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1683743005 Review URL: https://codereview.chromium.org/1683743005
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleText.cpp37
1 files changed, 0 insertions, 37 deletions
diff --git a/samplecode/SampleText.cpp b/samplecode/SampleText.cpp
index f5f8dbefa0..87ca91406b 100644
--- a/samplecode/SampleText.cpp
+++ b/samplecode/SampleText.cpp
@@ -27,41 +27,6 @@
#include "SkStream.h"
#include "SkXMLParser.h"
-static void test_breakText() {
- SkPaint paint;
- const char* text = "sdfkljAKLDFJKEWkldfjlk#$%&sdfs.dsj";
- size_t length = strlen(text);
- SkScalar width = paint.measureText(text, length);
-
- SkScalar mm = 0;
- SkScalar nn = 0;
- for (SkScalar w = 0; w <= width; w += SK_Scalar1) {
- SkScalar m;
- size_t n = paint.breakText(text, length, w, &m);
-
- SkASSERT(n <= length);
- SkASSERT(m <= width);
-
- if (n == 0) {
- SkASSERT(m == 0);
- } else {
- // now assert that we're monotonic
- if (n == nn) {
- SkASSERT(m == mm);
- } else {
- SkASSERT(n > nn);
- SkASSERT(m > mm);
- }
- }
- nn = SkIntToScalar((unsigned int)n);
- mm = m;
- }
-
- SkDEBUGCODE(size_t length2 =) paint.breakText(text, length, width, &mm);
- SkASSERT(length2 == length);
- SkASSERT(mm == width);
-}
-
static const struct {
const char* fName;
uint32_t fFlags;
@@ -109,8 +74,6 @@ public:
TextSpeedView() {
fHints = 0;
fClickX = 0;
-
- test_breakText();
}
protected: