| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "gm.h" | 8 #include "gm.h" |
| 9 #if SK_SUPPORT_GPU | 9 #if SK_SUPPORT_GPU |
| 10 #include "GrTest.h" | 10 #include "GrTest.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 case kEffect_Type: | 50 case kEffect_Type: |
| 51 name.append("_effect"); | 51 name.append("_effect"); |
| 52 break; | 52 break; |
| 53 } | 53 } |
| 54 return name; | 54 return name; |
| 55 } | 55 } |
| 56 | 56 |
| 57 SkISize onISize() SK_OVERRIDE { return SkISize::Make(kImageWidth, kImageHeig
ht); } | 57 SkISize onISize() SK_OVERRIDE { return SkISize::Make(kImageWidth, kImageHeig
ht); } |
| 58 | 58 |
| 59 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 59 void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
| 60 GrContext* context = NULL; |
| 60 #if SK_SUPPORT_GPU | 61 #if SK_SUPPORT_GPU |
| 61 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget
(); | 62 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget
(); |
| 62 GrContext* context = rt ? rt->getContext() : NULL; | 63 context = rt ? rt->getContext() : NULL; |
| 64 #endif |
| 63 if (kEffect_Type == fType && NULL == context) { | 65 if (kEffect_Type == fType && NULL == context) { |
| 66 this->drawGpuOnlyMessage(canvas); |
| 64 return; | 67 return; |
| 65 } | 68 } |
| 66 #endif | |
| 67 | 69 |
| 68 SkPaint paint; | 70 SkPaint paint; |
| 69 if (kAA_Draw_Type == fType) { | 71 if (kAA_Draw_Type == fType) { |
| 70 paint.setAntiAlias(true); | 72 paint.setAntiAlias(true); |
| 71 } | 73 } |
| 72 | 74 |
| 73 static const SkRect kMaxTileBound = SkRect::MakeWH(SkIntToScalar(kTileX)
, | 75 static const SkRect kMaxTileBound = SkRect::MakeWH(SkIntToScalar(kTileX)
, |
| 74 SkIntToScalar(kTileY)
); | 76 SkIntToScalar(kTileY)
); |
| 75 #ifdef SK_DEBUG | 77 #ifdef SK_DEBUG |
| 76 static const SkRect kMaxImageBound = SkRect::MakeWH(SkIntToScalar(kImage
Width), | 78 static const SkRect kMaxImageBound = SkRect::MakeWH(SkIntToScalar(kImage
Width), |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 255 |
| 254 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) | 256 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) |
| 255 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) | 257 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) |
| 256 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) | 258 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) |
| 257 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) | 259 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) |
| 258 #if SK_SUPPORT_GPU | 260 #if SK_SUPPORT_GPU |
| 259 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) | 261 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) |
| 260 #endif | 262 #endif |
| 261 | 263 |
| 262 } | 264 } |
| OLD | NEW |