| OLD | NEW |
| 1 /* libs/graphics/animator/SkDrawTextBox.cpp | 1 /* libs/graphics/animator/SkDrawTextBox.cpp |
| 2 ** | 2 ** |
| 3 ** Copyright 2006, The Android Open Source Project | 3 ** Copyright 2006, The Android Open Source Project |
| 4 ** | 4 ** |
| 5 ** Licensed under the Apache License, Version 2.0 (the "License"); | 5 ** Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 ** you may not use this file except in compliance with the License. | 6 ** you may not use this file except in compliance with the License. |
| 7 ** You may obtain a copy of the License at | 7 ** You may obtain a copy of the License at |
| 8 ** | 8 ** |
| 9 ** http://www.apache.org/licenses/LICENSE-2.0 | 9 ** http://www.apache.org/licenses/LICENSE-2.0 |
| 10 ** | 10 ** |
| 11 ** Unless required by applicable law or agreed to in writing, software | 11 ** Unless required by applicable law or agreed to in writing, software |
| 12 ** distributed under the License is distributed on an "AS IS" BASIS, | 12 ** distributed under the License is distributed on an "AS IS" BASIS, |
| 13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 ** See the License for the specific language governing permissions and | 14 ** See the License for the specific language governing permissions and |
| 15 ** limitations under the License. | 15 ** limitations under the License. |
| 16 */ | 16 */ |
| 17 | 17 |
| 18 #include "SkDrawTextBox.h" | 18 #include "SkDrawTextBox.h" |
| 19 #include "SkAnimateMaker.h" | 19 #include "SkAnimateMaker.h" |
| 20 #include "SkCanvas.h" | 20 #include "SkCanvas.h" |
| 21 #include "SkPaint.h" | 21 #include "SkPaint.h" |
| 22 | 22 |
| 23 enum SkDrawTextBox_Properties { | 23 enum SkDrawTextBox_Properties { |
| 24 foo = 100, | 24 foo = 100, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 48 fSpacingAdd = 0; | 48 fSpacingAdd = 0; |
| 49 spacingAlign = SkTextBox::kStart_SpacingAlign; | 49 spacingAlign = SkTextBox::kStart_SpacingAlign; |
| 50 mode = SkTextBox::kLineBreak_Mode; | 50 mode = SkTextBox::kLineBreak_Mode; |
| 51 } | 51 } |
| 52 | 52 |
| 53 #ifdef SK_DUMP_ENABLED | 53 #ifdef SK_DUMP_ENABLED |
| 54 void SkDrawTextBox::dump(SkAnimateMaker* maker) | 54 void SkDrawTextBox::dump(SkAnimateMaker* maker) |
| 55 { | 55 { |
| 56 dumpBase(maker); | 56 dumpBase(maker); |
| 57 dumpAttrs(maker); | 57 dumpAttrs(maker); |
| 58 if (mode == 0) | 58 if (mode == 0) |
| 59 SkDebugf("mode=\"oneLine\" "); | 59 SkDebugf("mode=\"oneLine\" "); |
| 60 if (spacingAlign == 1) | 60 if (spacingAlign == 1) |
| 61 SkDebugf("spacingAlign=\"center\" "); | 61 SkDebugf("spacingAlign=\"center\" "); |
| 62 else if (spacingAlign == 2) | 62 else if (spacingAlign == 2) |
| 63 SkDebugf("spacingAlign=\"end\" "); | 63 SkDebugf("spacingAlign=\"end\" "); |
| 64 SkDebugf("/>\n"); | 64 SkDebugf("/>\n"); |
| 65 } | 65 } |
| 66 #endif | 66 #endif |
| 67 | 67 |
| 68 bool SkDrawTextBox::getProperty(int index, SkScriptValue* value) const | 68 bool SkDrawTextBox::getProperty(int index, SkScriptValue* value) const |
| (...skipping 12 matching lines...) Expand all Loading... |
| 81 box.setMode((SkTextBox::Mode) mode); | 81 box.setMode((SkTextBox::Mode) mode); |
| 82 box.setSpacingAlign((SkTextBox::SpacingAlign) spacingAlign); | 82 box.setSpacingAlign((SkTextBox::SpacingAlign) spacingAlign); |
| 83 box.setBox(fRect); | 83 box.setBox(fRect); |
| 84 box.setSpacing(fSpacingMul, fSpacingAdd); | 84 box.setSpacing(fSpacingMul, fSpacingAdd); |
| 85 SkBoundableAuto boundable(this, maker); | 85 SkBoundableAuto boundable(this, maker); |
| 86 box.draw(maker.fCanvas, fText.c_str(), fText.size(), *maker.fPaint); | 86 box.draw(maker.fCanvas, fText.c_str(), fText.size(), *maker.fPaint); |
| 87 return false; | 87 return false; |
| 88 } | 88 } |
| 89 | 89 |
| 90 | 90 |
| OLD | NEW |