| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 // This test only works with the GPU backend. | 9 // This test only works with the GPU backend. |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 virtual SkString onShortName() { | 32 virtual SkString onShortName() { |
| 33 return SkString("texdata"); | 33 return SkString("texdata"); |
| 34 } | 34 } |
| 35 | 35 |
| 36 virtual SkISize onISize() { | 36 virtual SkISize onISize() { |
| 37 return make_isize(2*S, 2*S); | 37 return make_isize(2*S, 2*S); |
| 38 } | 38 } |
| 39 | 39 |
| 40 virtual void onDraw(SkCanvas* canvas) { | 40 virtual void onDraw(SkCanvas* canvas) { |
| 41 SkDevice* device = canvas->getTopDevice(); | 41 SkDevice* device = canvas->getTopDevice(); |
| 42 GrRenderTarget* target = (GrRenderTarget*) device->accessRenderTarget(); | 42 GrRenderTarget* target = device->accessRenderTarget(); |
| 43 GrContext* ctx = GetGr(); | 43 GrContext* ctx = GetGr(); |
| 44 if (ctx && target) { | 44 if (ctx && target) { |
| 45 SkPMColor gTextureData[(2 * S) * (2 * S)]; | 45 SkPMColor gTextureData[(2 * S) * (2 * S)]; |
| 46 static const int stride = 2 * S; | 46 static const int stride = 2 * S; |
| 47 static const SkPMColor gray = SkPackARGB32(0x40, 0x40, 0x40, 0x40); | 47 static const SkPMColor gray = SkPackARGB32(0x40, 0x40, 0x40, 0x40); |
| 48 static const SkPMColor white = SkPackARGB32(0xff, 0xff, 0xff, 0xff); | 48 static const SkPMColor white = SkPackARGB32(0xff, 0xff, 0xff, 0xff); |
| 49 static const SkPMColor red = SkPackARGB32(0x80, 0x80, 0x00, 0x00); | 49 static const SkPMColor red = SkPackARGB32(0x80, 0x80, 0x00, 0x00); |
| 50 static const SkPMColor blue = SkPackARGB32(0x80, 0x00, 0x00, 0x80); | 50 static const SkPMColor blue = SkPackARGB32(0x80, 0x00, 0x00, 0x80); |
| 51 static const SkPMColor green = SkPackARGB32(0x80, 0x00, 0x80, 0x00); | 51 static const SkPMColor green = SkPackARGB32(0x80, 0x00, 0x80, 0x00); |
| 52 static const SkPMColor black = SkPackARGB32(0x00, 0x00, 0x00, 0x00); | 52 static const SkPMColor black = SkPackARGB32(0x00, 0x00, 0x00, 0x00); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 ////////////////////////////////////////////////////////////////////////////// | 141 ////////////////////////////////////////////////////////////////////////////// |
| 142 | 142 |
| 143 static GM* MyFactory(void*) { return new TexDataGM; } | 143 static GM* MyFactory(void*) { return new TexDataGM; } |
| 144 static GMRegistry reg(MyFactory); | 144 static GMRegistry reg(MyFactory); |
| 145 | 145 |
| 146 } | 146 } |
| 147 | 147 |
| 148 #endif | 148 #endif |
| OLD | NEW |