Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 1 | #if 0 // Disabled until updated to use current API. |
| 2 | // Copyright 2019 Google LLC. |
| 3 | // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 4 | #include "tools/fiddle/examples.h" |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 5 | // HASH=d6f5a3d21727ddc15e10ef4d5103ff91 |
Hal Canary | a7181e7c | 2019-03-18 16:06:34 -0400 | [diff] [blame] | 6 | REG_FIDDLE(RRect_writeToMemory, 256, 110, false, 0) { |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 7 | void draw(SkCanvas* canvas) { |
| 8 | SkRRect rrect = SkRRect::MakeRect({10, 10, 110, 80}); |
| 9 | char storage[SkRRect::kSizeInMemory]; |
| 10 | rrect.writeToMemory(storage); |
| 11 | SkRRect copy; |
| 12 | copy.readFromMemory(storage, sizeof(storage)); |
| 13 | SkPaint paint; |
| 14 | paint.setAntiAlias(true); |
| 15 | canvas->drawString("rrect", 55, 100, paint); |
| 16 | canvas->drawString("copy", 185, 100, paint); |
| 17 | paint.setStyle(SkPaint::kStroke_Style); |
| 18 | canvas->drawRRect(rrect, paint); |
| 19 | canvas->translate(120, 0); |
| 20 | canvas->drawRRect(copy, paint); |
| 21 | } |
| 22 | } // END FIDDLE |
| 23 | #endif // Disabled until updated to use current API. |