diff options
Diffstat (limited to 'gm/strokerects.cpp')
-rw-r--r-- | gm/strokerects.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/gm/strokerects.cpp b/gm/strokerects.cpp index 891b95a..92f2a18 100644 --- a/gm/strokerects.cpp +++ b/gm/strokerects.cpp @@ -1,20 +1,13 @@ -/* - Copyright 2011 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 2011 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. */ + #include "gm.h" #include "SkRandom.h" @@ -45,14 +38,14 @@ protected: SkScalar y = rand.nextUScalar1() * H; SkScalar w = rand.nextUScalar1() * (W >> 2); SkScalar h = rand.nextUScalar1() * (H >> 2); + SkScalar hoffset = rand.nextSScalar1(); + SkScalar woffset = rand.nextSScalar1(); r->set(x, y, x + w, y + h); - r->offset(-w/2 + rand.nextSScalar1(), -h/2 + + rand.nextSScalar1()); + r->offset(-w/2 + woffset, -h/2 + hoffset); } virtual void onDraw(SkCanvas* canvas) { - canvas->drawColor(SK_ColorWHITE); - SkPaint paint; paint.setStyle(SkPaint::kStroke_Style); |