| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 | 9 |
| 10 #include "Resources.h" | 10 #include "Resources.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 FilterIndiaBoxGM() { | 64 FilterIndiaBoxGM() { |
| 65 this->setBGColor(0xFFDDDDDD); | 65 this->setBGColor(0xFFDDDDDD); |
| 66 } | 66 } |
| 67 | 67 |
| 68 FilterIndiaBoxGM(const char filename[]) : fFilename(filename) { | 68 FilterIndiaBoxGM(const char filename[]) : fFilename(filename) { |
| 69 fName.printf("filterindiabox"); | 69 fName.printf("filterindiabox"); |
| 70 } | 70 } |
| 71 | 71 |
| 72 protected: | 72 protected: |
| 73 virtual SkString onShortName() SK_OVERRIDE { | 73 SkString onShortName() SK_OVERRIDE { |
| 74 return fName; | 74 return fName; |
| 75 } | 75 } |
| 76 | 76 |
| 77 #ifdef SK_CPU_ARM64 | 77 #ifdef SK_CPU_ARM64 |
| 78 // Skip tiled drawing on 64-bit ARM until https://skbug.com/2908 is fixed. | 78 // Skip tiled drawing on 64-bit ARM until https://skbug.com/2908 is fixed. |
| 79 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 79 uint32_t onGetFlags() const SK_OVERRIDE { |
| 80 return kSkipTiled_Flag; | 80 return kSkipTiled_Flag; |
| 81 } | 81 } |
| 82 #endif | 82 #endif |
| 83 | 83 |
| 84 virtual SkISize onISize() SK_OVERRIDE { | 84 SkISize onISize() SK_OVERRIDE { |
| 85 return SkISize::Make(1024, 768); | 85 return SkISize::Make(1024, 768); |
| 86 } | 86 } |
| 87 | 87 |
| 88 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 88 void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
| 89 canvas->translate(10, 10); | 89 canvas->translate(10, 10); |
| 90 for (size_t i = 0; i < SK_ARRAY_COUNT(fMatrix); ++i) { | 90 for (size_t i = 0; i < SK_ARRAY_COUNT(fMatrix); ++i) { |
| 91 SkSize size = computeSize(fBM, fMatrix[i]); | 91 SkSize size = computeSize(fBM, fMatrix[i]); |
| 92 size.fWidth += 20; | 92 size.fWidth += 20; |
| 93 size.fHeight += 20; | 93 size.fHeight += 20; |
| 94 | 94 |
| 95 draw_row(canvas, fBM, fMatrix[i], size.fWidth); | 95 draw_row(canvas, fBM, fMatrix[i], size.fWidth); |
| 96 canvas->translate(0, size.fHeight); | 96 canvas->translate(0, size.fHeight); |
| 97 } | 97 } |
| 98 } | 98 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 123 fSize = fBM.height(); | 123 fSize = fBM.height(); |
| 124 } | 124 } |
| 125 private: | 125 private: |
| 126 typedef skiagm::GM INHERITED; | 126 typedef skiagm::GM INHERITED; |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 ////////////////////////////////////////////////////////////////////////////// | 129 ////////////////////////////////////////////////////////////////////////////// |
| 130 | 130 |
| 131 | 131 |
| 132 DEF_GM( return new FilterIndiaBoxGM("box.gif"); ) | 132 DEF_GM( return new FilterIndiaBoxGM("box.gif"); ) |
| OLD | NEW |