| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "Test.h" | |
| 9 #include "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 10 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 11 #include "SkColor.h" | 10 #include "SkColor.h" |
| 12 #include "SkFontHost.h" | 11 #include "SkFontHost.h" |
| 13 #include "SkGraphics.h" | 12 #include "SkGraphics.h" |
| 14 #include "SkPaint.h" | 13 #include "SkPaint.h" |
| 15 #include "SkPoint.h" | 14 #include "SkPoint.h" |
| 16 #include "SkRect.h" | 15 #include "SkRect.h" |
| 17 #include "SkStream.h" | 16 #include "SkStream.h" |
| 18 #include "SkTypeface.h" | 17 #include "SkTypeface.h" |
| 19 #include "SkTypes.h" | 18 #include "SkTypes.h" |
| 19 #include "Test.h" |
| 20 | 20 |
| 21 static const SkColor bgColor = SK_ColorWHITE; | 21 static const SkColor bgColor = SK_ColorWHITE; |
| 22 | 22 |
| 23 static void create(SkBitmap* bm, SkIRect bound, SkBitmap::Config config) { | 23 static void create(SkBitmap* bm, SkIRect bound, SkBitmap::Config config) { |
| 24 bm->setConfig(config, bound.width(), bound.height()); | 24 bm->setConfig(config, bound.width(), bound.height()); |
| 25 bm->allocPixels(); | 25 bm->allocPixels(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 static void drawBG(SkCanvas* canvas) { | 28 static void drawBG(SkCanvas* canvas) { |
| 29 canvas->drawColor(bgColor); | 29 canvas->drawColor(bgColor); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 SkSafeUnref(paint.setTypeface(streamTypeface)); | 102 SkSafeUnref(paint.setTypeface(streamTypeface)); |
| 103 drawBG(&streamCanvas); | 103 drawBG(&streamCanvas); |
| 104 streamCanvas.drawPosText("A", 1, &point, paint); | 104 streamCanvas.drawPosText("A", 1, &point, paint); |
| 105 | 105 |
| 106 REPORTER_ASSERT(reporter, | 106 REPORTER_ASSERT(reporter, |
| 107 compare(origBitmap, origRect, streamBitmap, streamRect))
; | 107 compare(origBitmap, origRect, streamBitmap, streamRect))
; |
| 108 } | 108 } |
| 109 //Make sure the typeface is deleted and removed. | 109 //Make sure the typeface is deleted and removed. |
| 110 SkGraphics::PurgeFontCache(); | 110 SkGraphics::PurgeFontCache(); |
| 111 } | 111 } |
| OLD | NEW |