| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright 2015 Google Inc. | 2  * Copyright 2015 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 // This test only works with the GPU backend. | 8 // This test only works with the GPU backend. | 
| 9 | 9 | 
| 10 #include "gm.h" | 10 #include "gm.h" | 
| (...skipping 13 matching lines...) Expand all  Loading... | 
| 24     ImageFromYUVTextures() { | 24     ImageFromYUVTextures() { | 
| 25         this->setBGColor(0xFFFFFFFF); | 25         this->setBGColor(0xFFFFFFFF); | 
| 26     } | 26     } | 
| 27 | 27 | 
| 28 protected: | 28 protected: | 
| 29     SkString onShortName() override { | 29     SkString onShortName() override { | 
| 30         return SkString("image_from_yuv_textures"); | 30         return SkString("image_from_yuv_textures"); | 
| 31     } | 31     } | 
| 32 | 32 | 
| 33     SkISize onISize() override { | 33     SkISize onISize() override { | 
| 34         return SkISize::Make(50, 135); | 34         return SkISize::Make(50, 175); | 
| 35     } | 35     } | 
| 36 | 36 | 
| 37     void onOnceBeforeDraw() override { | 37     void onOnceBeforeDraw() override { | 
| 38         // We create an RGB bitmap and then extract YUV bmps where the U and V b
     itmaps are | 38         // We create an RGB bitmap and then extract YUV bmps where the U and V b
     itmaps are | 
| 39         // subsampled by 2 in both dimensions. | 39         // subsampled by 2 in both dimensions. | 
| 40         SkPaint paint; | 40         SkPaint paint; | 
| 41         static const SkColor kColors[] = | 41         static const SkColor kColors[] = | 
| 42             { SK_ColorBLUE, SK_ColorYELLOW, SK_ColorGREEN, SK_ColorWHITE }; | 42             { SK_ColorBLUE, SK_ColorYELLOW, SK_ColorGREEN, SK_ColorWHITE }; | 
| 43         paint.setShader(SkGradientShader::MakeRadial(SkPoint::Make(0,0), kBmpSiz
     e / 2.f, kColors, | 43         paint.setShader(SkGradientShader::MakeRadial(SkPoint::Make(0,0), kBmpSiz
     e / 2.f, kColors, | 
| 44                                                      nullptr, SK_ARRAY_COUNT(kCo
     lors), | 44                                                      nullptr, SK_ARRAY_COUNT(kCo
     lors), | 
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 163 | 163 | 
| 164     static const int kBmpSize = 32; | 164     static const int kBmpSize = 32; | 
| 165 | 165 | 
| 166     typedef GM INHERITED; | 166     typedef GM INHERITED; | 
| 167 }; | 167 }; | 
| 168 | 168 | 
| 169 DEF_GM(return new ImageFromYUVTextures;) | 169 DEF_GM(return new ImageFromYUVTextures;) | 
| 170 } | 170 } | 
| 171 | 171 | 
| 172 #endif | 172 #endif | 
| OLD | NEW | 
|---|