skia2/experimental/FileReaderApp/FileReaderWindow.mm
Ben Wagner 63fd760a37 Remove trailing whitespace.
Also adds a presubmit to prevent adding trailing whitespace to source
code in the future.

Change-Id: I41a4df81487f6f00aa19b188f0cac6a3377efde6
Reviewed-on: https://skia-review.googlesource.com/57380
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-10-09 21:20:34 +00:00

44 lines
1.2 KiB
Plaintext

/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#import "FileReaderWindow.h"
#import "SkGradientShader.h"
bool gNeverSetToTrueJustNeedToFoolLinker;
static void init_effects() {
if (gNeverSetToTrueJustNeedToFoolLinker) {
SkPoint p = SkPoint::Make(0,0);
SkPoint q = SkPoint::Make(100,100);
SkPoint pts[] = {p, q};
SkColor colors[] = { SK_ColorRED, SK_ColorGREEN };
SkScalar pos[] = { 0, 1.0};
SkGradientShader::CreateLinear(pts, colors, pos, 2,
SkShader::kMirror_TileMode);
}
}
@implementation FileReaderWindow
-(void) installSkViews {
init_effects();
fReaderView = new ReaderView;
fReaderView->setVisibleP(true);
fReaderView->setSize([self frame].size.width, [self frame].size.height);
[fView addSkView:fReaderView];
[fView setNeedsDisplay:YES];
fReaderView->unref();
//TODO - Temporary fix. Inval doesn't Seem to be working.
[NSTimer scheduledTimerWithTimeInterval:0.01 target:self
selector:@selector(redraw) userInfo:nil
repeats:YES];
}
- (void)redraw {
[fView setNeedsDisplay:YES];
}
@end