diff options
Diffstat (limited to 'skia/include/corecg/SkRect.h')
-rw-r--r-- | skia/include/corecg/SkRect.h | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/skia/include/corecg/SkRect.h b/skia/include/corecg/SkRect.h index 65a562e..a9f25aa 100644 --- a/skia/include/corecg/SkRect.h +++ b/skia/include/corecg/SkRect.h @@ -1,19 +1,18 @@ -/* include/corecg/SkRect.h -** -** Copyright 2006, Google Inc. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ +/* + * Copyright (C) 2006 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef SkRect_DEFINED #define SkRect_DEFINED @@ -280,6 +279,16 @@ struct SkRect { fRight = right; fBottom = bottom; } + + /** Initialize the rect with the 4 specified integers. The routine handles + converting them to scalars (by calling SkIntToScalar) + */ + void iset(int left, int top, int right, int bottom) { + fLeft = SkIntToScalar(left); + fTop = SkIntToScalar(top); + fRight = SkIntToScalar(right); + fBottom = SkIntToScalar(bottom); + } /** Set this rectangle to be the bounds of the array of points. If the array is empty (count == 0), then set this rectangle |