| 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 13 matching lines...) Expand all Loading... |
| 24 TexDataGM() { | 24 TexDataGM() { |
| 25 this->setBGColor(0xff000000); | 25 this->setBGColor(0xff000000); |
| 26 } | 26 } |
| 27 | 27 |
| 28 protected: | 28 protected: |
| 29 virtual SkString onShortName() { | 29 virtual SkString onShortName() { |
| 30 return SkString("texdata"); | 30 return SkString("texdata"); |
| 31 } | 31 } |
| 32 | 32 |
| 33 virtual SkISize onISize() { | 33 virtual SkISize onISize() { |
| 34 return make_isize(2*S, 2*S); | 34 return SkISize::Make(2*S, 2*S); |
| 35 } | 35 } |
| 36 | 36 |
| 37 virtual uint32_t onGetFlags() const SK_OVERRIDE { return kGPUOnly_Flag; } | 37 virtual uint32_t onGetFlags() const SK_OVERRIDE { return kGPUOnly_Flag; } |
| 38 | 38 |
| 39 virtual void onDraw(SkCanvas* canvas) { | 39 virtual void onDraw(SkCanvas* canvas) { |
| 40 GrRenderTarget* target = canvas->internal_private_accessTopLayerRenderTa
rget(); | 40 GrRenderTarget* target = canvas->internal_private_accessTopLayerRenderTa
rget(); |
| 41 GrContext* ctx = canvas->getGrContext(); | 41 GrContext* ctx = canvas->getGrContext(); |
| 42 if (ctx && target) { | 42 if (ctx && target) { |
| 43 SkAutoTArray<SkPMColor> gTextureData((2 * S) * (2 * S)); | 43 SkAutoTArray<SkPMColor> gTextureData((2 * S) * (2 * S)); |
| 44 static const int stride = 2 * S; | 44 static const int stride = 2 * S; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 ////////////////////////////////////////////////////////////////////////////// | 139 ////////////////////////////////////////////////////////////////////////////// |
| 140 | 140 |
| 141 static GM* MyFactory(void*) { return new TexDataGM; } | 141 static GM* MyFactory(void*) { return new TexDataGM; } |
| 142 static GMRegistry reg(MyFactory); | 142 static GMRegistry reg(MyFactory); |
| 143 | 143 |
| 144 } | 144 } |
| 145 | 145 |
| 146 #endif | 146 #endif |
| OLD | NEW |