blob: ed4585e1403f301e263ad440767e9ad75f09f195 [file] [log] [blame]
Ben Wagner63fd7602017-10-09 15:45:33 -04001/*
2 * Copyright 2011 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
yangsu@google.com02642762011-06-17 18:31:01 +00008#import "FileReaderWindow.h"
9#import "SkGradientShader.h"
10
11bool gNeverSetToTrueJustNeedToFoolLinker;
12static void init_effects() {
13 if (gNeverSetToTrueJustNeedToFoolLinker) {
14 SkPoint p = SkPoint::Make(0,0);
15 SkPoint q = SkPoint::Make(100,100);
16 SkPoint pts[] = {p, q};
17 SkColor colors[] = { SK_ColorRED, SK_ColorGREEN };
18 SkScalar pos[] = { 0, 1.0};
Ben Wagner63fd7602017-10-09 15:45:33 -040019 SkGradientShader::CreateLinear(pts, colors, pos, 2,
yangsu@google.com02642762011-06-17 18:31:01 +000020 SkShader::kMirror_TileMode);
21 }
22}
23
24@implementation FileReaderWindow
25-(void) installSkViews {
26 init_effects();
27 fReaderView = new ReaderView;
28 fReaderView->setVisibleP(true);
29 fReaderView->setSize([self frame].size.width, [self frame].size.height);
30 [fView addSkView:fReaderView];
31 [fView setNeedsDisplay:YES];
32 fReaderView->unref();
Ben Wagner63fd7602017-10-09 15:45:33 -040033 //TODO - Temporary fix. Inval doesn't Seem to be working.
34 [NSTimer scheduledTimerWithTimeInterval:0.01 target:self
35 selector:@selector(redraw) userInfo:nil
yangsu@google.com02642762011-06-17 18:31:01 +000036 repeats:YES];
37}
38
39- (void)redraw {
40 [fView setNeedsDisplay:YES];
41}
Ben Wagner63fd7602017-10-09 15:45:33 -040042@end
43