| 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 #include "gm.h" | 8 #include "gm.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 //#include "SkParsePath.h" | 10 //#include "SkParsePath.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 canvas->translate(SkIntToScalar(20), SkIntToScalar(20)); | 95 canvas->translate(SkIntToScalar(20), SkIntToScalar(20)); |
| 96 canvas->scale(3 * SK_Scalar1 / 4, 3 * SK_Scalar1 / 4); | 96 canvas->scale(3 * SK_Scalar1 / 4, 3 * SK_Scalar1 / 4); |
| 97 | 97 |
| 98 if (fDoSaveLayer) { | 98 if (fDoSaveLayer) { |
| 99 // We want the layer to appear symmetric relative to actual | 99 // We want the layer to appear symmetric relative to actual |
| 100 // device boundaries so we need to "undo" the effect of the | 100 // device boundaries so we need to "undo" the effect of the |
| 101 // scale and translate | 101 // scale and translate |
| 102 SkRect bounds = SkRect::MakeLTRB( | 102 SkRect bounds = SkRect::MakeLTRB( |
| 103 SkFloatToScalar(4.0f/3.0f * -20), | 103 4.0f/3.0f * -20, |
| 104 SkFloatToScalar(4.0f/3.0f * -20), | 104 4.0f/3.0f * -20, |
| 105 SkFloatToScalar(4.0f/3.0f * (this->getISize().fWidth - 20)), | 105 4.0f/3.0f * (this->getISize().fWidth - 20), |
| 106 SkFloatToScalar(4.0f/3.0f * (this->getISize().fHeight - 20))); | 106 4.0f/3.0f * (this->getISize().fHeight - 20)); |
| 107 | 107 |
| 108 bounds.inset(SkIntToScalar(100), SkIntToScalar(100)); | 108 bounds.inset(SkIntToScalar(100), SkIntToScalar(100)); |
| 109 SkPaint boundPaint; | 109 SkPaint boundPaint; |
| 110 boundPaint.setColor(SK_ColorRED); | 110 boundPaint.setColor(SK_ColorRED); |
| 111 boundPaint.setStyle(SkPaint::kStroke_Style); | 111 boundPaint.setStyle(SkPaint::kStroke_Style); |
| 112 canvas->drawRect(bounds, boundPaint); | 112 canvas->drawRect(bounds, boundPaint); |
| 113 canvas->saveLayer(&bounds, NULL); | 113 canvas->saveLayer(&bounds, NULL); |
| 114 } | 114 } |
| 115 | 115 |
| 116 for (int invBits = 0; invBits < 4; ++invBits) { | 116 for (int invBits = 0; invBits < 4; ++invBits) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 // aliased and anti-aliased w/ a layer | 188 // aliased and anti-aliased w/ a layer |
| 189 static GM* gFact2(void*) { return new ComplexClipGM(false, true); } | 189 static GM* gFact2(void*) { return new ComplexClipGM(false, true); } |
| 190 static GM* gFact3(void*) { return new ComplexClipGM(true, true); } | 190 static GM* gFact3(void*) { return new ComplexClipGM(true, true); } |
| 191 | 191 |
| 192 static GMRegistry gReg0(gFact0); | 192 static GMRegistry gReg0(gFact0); |
| 193 static GMRegistry gReg1(gFact1); | 193 static GMRegistry gReg1(gFact1); |
| 194 static GMRegistry gReg2(gFact2); | 194 static GMRegistry gReg2(gFact2); |
| 195 static GMRegistry gReg3(gFact3); | 195 static GMRegistry gReg3(gFact3); |
| 196 | 196 |
| 197 } | 197 } |
| OLD | NEW |