diff options
author | yangsu@google.com <yangsu@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-08 15:12:05 +0000 |
---|---|---|
committer | yangsu@google.com <yangsu@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-08 15:12:05 +0000 |
commit | f3493f0e1f92a8a284adb93ecbf350401e1c7423 (patch) | |
tree | 6a2e7b99bbcbf566b184b8789c4452ee175f9ff1 /experimental/iOSSampleApp | |
parent | 0168afc7196fe82da8af230c93c56f3035d54d2b (diff) |
iOS/Cocoa SampleApp, Drawingboard, and Networking updates
http://codereview.appspot.com/4843041/
http://codereview.appspot.com/4826061/
http://codereview.appspot.com/4832044/
http://codereview.appspot.com/4798055/
git-svn-id: http://skia.googlecode.com/svn/trunk@2058 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'experimental/iOSSampleApp')
13 files changed, 174 insertions, 542 deletions
diff --git a/experimental/iOSSampleApp/Shared/DrawingBoard/SkColorPalette.cpp b/experimental/iOSSampleApp/Shared/DrawingBoard/SkColorPalette.cpp deleted file mode 100644 index c1c3f9400e..0000000000 --- a/experimental/iOSSampleApp/Shared/DrawingBoard/SkColorPalette.cpp +++ /dev/null @@ -1,189 +0,0 @@ - -/* - * 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 "SkView.h" -#include "SkCanvas.h" -#include "SkPaint.h" -#include "SkGradientShader.h" -#include "SkColorPalette.h" - -SkColorPalette::SkColorPalette() { - fSlotRect = SkRect::MakeWH(SkIntToScalar(50), SkIntToScalar(20)); - fGradientRect = SkRect::MakeWH(SkIntToScalar(100), SkIntToScalar(100)); - fSelected = 0; - fCurrColor = 0xFF000000; - for (int i = 0; i < PaletteSlots; ++i) { - fColors[i] = 0xFF000000; - } -} - -bool SkColorPalette::onEvent(const SkEvent& evt) { - return this->INHERITED::onEvent(evt); -} - -void SkColorPalette::onDraw(SkCanvas* canvas) { - canvas->drawColor(0xFFEEEEEE); - - SkPaint paint; - paint.setAntiAlias(true); - paint.setStyle(SkPaint::kStrokeAndFill_Style); - - canvas->translate(PalettePadding, PalettePadding); - for (int i = 0; i < PaletteSlots; ++i) { - if (fSelected == i) { - paint.setStrokeWidth(SkIntToScalar(3)); - } - else { - paint.setStrokeWidth(0); - } - - paint.setColor(fColors[i]); - canvas->drawRect(fSlotRect, paint); - - canvas->translate(0, fSlotRect.height() + PalettePadding); - } - paint.setStrokeWidth(0); - canvas->translate(0, PalettePadding); - SkPoint p = SkPoint::Make(0,0); - SkPoint q = SkPoint::Make(this->width(), 0); - SkPoint pts[] = {p, q}; - - SkColor colors[] = { SK_ColorRED, SK_ColorYELLOW, SK_ColorGREEN, - SK_ColorCYAN, SK_ColorBLUE, SK_ColorMAGENTA,SK_ColorRED}; - SkScalar colorPositions[] = { 0, 0.2, 0.4, 0.5, 0.6, 0.8, 1.0}; - - - SkShader* shader1 = SkGradientShader::CreateLinear(pts, colors, colorPositions,7, - SkShader::kMirror_TileMode); - paint.setShader(shader1)->unref(); - - canvas->drawRect(fGradientRect, paint); - - //this->INHERITED::onDraw(canvas); -} - -SkView::Click* SkColorPalette::onFindClickHandler(SkScalar x, SkScalar y) { - return new Click(this); -} - -bool SkColorPalette::onClick(SkView::Click* click) { - SkPoint curr = click->fCurr; - //SkDebugf("click %f %f \n", curr.fX, curr.fY); - int selected = selectSlot(curr); - if (selected >= 0) { - switch (click->fState) { - case SkView::Click::kDown_State: - case SkView::Click::kMoved_State: - case SkView::Click::kUp_State: - fSelected = selected; - fCurrColor = fColors[fSelected]; - break; - default: - break; - } - return true; - } - else{ - //account for padding - curr.fX -= PalettePadding; - curr.fY -= 2 * PalettePadding + (fSlotRect.height() + PalettePadding) * PaletteSlots; - if (curr.fX < 0 || curr.fX > fGradientRect.width() || - curr.fY < 0 || curr.fY > fGradientRect.height()) { - return false; - } - else { - switch (click->fState) { - case SkView::Click::kDown_State: - case SkView::Click::kMoved_State: - case SkView::Click::kUp_State: - fColors[fSelected] = selectColorFromGradient(curr); - fCurrColor = fColors[fSelected]; - break; - default: - break; - } - return true; - } - } -} - -void SkColorPalette::onSizeChange() { - fGradientRect = SkRect::MakeWH(this->width() - 2*PalettePadding, - this->width() - 2*PalettePadding); - this->INHERITED::onSizeChange(); -} - -int SkColorPalette::selectSlot(SkPoint& cursorPosition) { - //account for padding - cursorPosition.fX -= PalettePadding; - cursorPosition.fY -= PalettePadding; - - if (cursorPosition.fX < 0 || cursorPosition.fX > fSlotRect.width() || - cursorPosition.fY < 0 || cursorPosition.fY > (fSlotRect.height() + PalettePadding) * PaletteSlots) { - return -1; - } - int index = cursorPosition.fY/(fSlotRect.height() + PalettePadding); - int offset = (int)cursorPosition.fY%((int)fSlotRect.height() + PalettePadding); - if (offset <= fSlotRect.height()) { - return index; - } - else { - return -1; - } -} - -SkColor SkColorPalette::selectColorFromGradient(SkPoint& cursorPosition) { - float h = cursorPosition.fX/fGradientRect.width(); - float s = 1.0 - cursorPosition.fY/fGradientRect.height(); - float v = 1.0; - float _h,r,g,b; - float _1, _2, _3; - int _i; - - _h = h * 6; - _i = (int)_h; - _1 = v * (1 - s); - _2 = v * (1 - s * (_h - _i)); - _3 = v * (1 - s * (1 - (_h - _i))); - - if (_i == 0) { - r = v; - g = _3; - b = _1; - } - else if (_i == 1) { - r = _2; - g = v; - b = _1; - } - else if (_i == 2) { - r = _1; - g = v; - b = _3; - } - else if (_i == 3) { - r = _1; - g = _2; - b = v; - } - else if (_i == 4) { - r = _3; - g = _1; - b = v; - } - else { - r = v; - g = _1; - b = _2; - }; - - SkColor retval = 0xFF000000; - retval += ((int)(r * 255) << 16); - retval += ((int)(g * 255) << 8); - retval += (int)(b * 255); - return retval; -}
\ No newline at end of file diff --git a/experimental/iOSSampleApp/Shared/DrawingBoard/SkColorPalette.h b/experimental/iOSSampleApp/Shared/DrawingBoard/SkColorPalette.h deleted file mode 100644 index e8032cddd2..0000000000 --- a/experimental/iOSSampleApp/Shared/DrawingBoard/SkColorPalette.h +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * Copyright 2011 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ -#ifndef SkColorPalette_DEFINED -#define SkColorPalette_DEFINED - -#define PaletteSlots 5 -#define PalettePadding 5 -class SkColorPalette : public SkView { -public: - SkColorPalette(); - SkColor getColor() { return fCurrColor; } -protected: - virtual bool onEvent(const SkEvent& evt); - virtual void onDraw(SkCanvas* canvas); - virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y); - virtual bool onClick(SkView::Click* click); - virtual void onSizeChange(); -private: - int selectSlot(SkPoint& cursorPosition); - SkColor selectColorFromGradient(SkPoint& cursorPosition); - int fSelected; - SkRect fGradientRect; - SkRect fSlotRect; - SkColor fCurrColor; - SkColor fColors[PaletteSlots]; - typedef SkView INHERITED; -}; - -#endif
\ No newline at end of file diff --git a/experimental/iOSSampleApp/Shared/DrawingBoard/SkNetPipeController.cpp b/experimental/iOSSampleApp/Shared/DrawingBoard/SkNetPipeController.cpp deleted file mode 100644 index e047ba873d..0000000000 --- a/experimental/iOSSampleApp/Shared/DrawingBoard/SkNetPipeController.cpp +++ /dev/null @@ -1,51 +0,0 @@ - -/* - * 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 "SkNetPipeController.h" - -SkNetPipeController::SkNetPipeController(SkCanvas* target) : fReader(target) { - fBlock = NULL; - fBlockSize = fBytesWritten = 0; - fPlayback = true; - fStatus = SkGPipeReader::kDone_Status; - fTotalWritten = 0; - fAtomsWritten = 0; -} -SkNetPipeController::~SkNetPipeController() { - sk_free(fBlock); -} - -int SkNetPipeController::writeToSocket(SkSocket* sockfd, SkSocket::DataType type) { - if (NULL != sockfd && fTotalWritten > 4) - return sockfd->writePacket(fBlock, fBytesWritten, type); - else - return -1; -} - -void* SkNetPipeController::requestBlock(size_t minRequest, size_t* actual) { - sk_free(fBlock); - - fBlockSize = minRequest * 4; - fBlock = sk_malloc_throw(fBlockSize); - fBytesWritten = 0; - *actual = fBlockSize; - return fBlock; -} - -void SkNetPipeController::notifyWritten(size_t bytes) { - SkASSERT(fBytesWritten + bytes <= fBlockSize); - - if (fPlayback) { - fStatus = fReader.playback((const char*)fBlock + fBytesWritten, bytes); - } - - SkASSERT(SkGPipeReader::kError_Status != fStatus); - fBytesWritten += bytes; - fTotalWritten += bytes; - - fAtomsWritten += 1; -}
\ No newline at end of file diff --git a/experimental/iOSSampleApp/Shared/DrawingBoard/SkNetPipeController.h b/experimental/iOSSampleApp/Shared/DrawingBoard/SkNetPipeController.h deleted file mode 100644 index b59d067ce5..0000000000 --- a/experimental/iOSSampleApp/Shared/DrawingBoard/SkNetPipeController.h +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * Copyright 2011 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ -#ifndef SkNetPipeController_DEFINED -#define SkNetPipeController_DEFINED -#include "SkTypes.h" -#include "SkCanvas.h" -#include "SkGPipe.h" -#include "SkSockets.h" -class SkNetPipeController : public SkGPipeController { -public: - SkNetPipeController(SkCanvas* target); - ~SkNetPipeController(); - - virtual void* requestBlock(size_t minRequest, size_t* actual); - virtual void notifyWritten(size_t bytes); - - int writeToSocket(SkSocket* sockfd, SkSocket::DataType type); - void enablePlayback() { fPlayback = true; } - void disablePlayback() { fPlayback = false; } - -private: - SkGPipeReader fReader; - bool fPlayback; - void* fBlock; - size_t fBlockSize; - size_t fBytesWritten; - int fAtomsWritten; - size_t fTotalWritten; - - SkGPipeReader::Status fStatus; -}; -#endif
\ No newline at end of file diff --git a/experimental/iOSSampleApp/Shared/SkAlertPrompt.h b/experimental/iOSSampleApp/Shared/SkAlertPrompt.h deleted file mode 100644 index 51a1a5b1f1..0000000000 --- a/experimental/iOSSampleApp/Shared/SkAlertPrompt.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * 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 <UIKit/UIKit.h> - - -@interface SkAlertPrompt : UIAlertView { - UITextField *textField; -} -@property (nonatomic, retain) UITextField *textField; - -- (NSString*)enteredText; - -@end diff --git a/experimental/iOSSampleApp/Shared/SkAlertPrompt.m b/experimental/iOSSampleApp/Shared/SkAlertPrompt.m deleted file mode 100644 index be0adf520b..0000000000 --- a/experimental/iOSSampleApp/Shared/SkAlertPrompt.m +++ /dev/null @@ -1,49 +0,0 @@ -// -// SkAlertPrompt.m -// iOSSampleApp -// -// Created by Yang Su on 7/6/11. -// 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 "SkAlertPrompt.h" - -@implementation SkAlertPrompt -@synthesize textField; - -- (id)initWithTitle:(NSString *)title - message:(NSString *)message - delegate:(id)delegate - cancelButtonTitle:(NSString *)cancelButtonTitle - otherButtonTitles:(NSString *)okayButtonTitle,... { - if (self = [super initWithTitle:title - message:message - delegate:delegate - cancelButtonTitle:cancelButtonTitle - otherButtonTitles:okayButtonTitle, nil]) { - self.textField = [[UITextField alloc] - initWithFrame:CGRectMake(12, 45, 260, 25)]; - [self.textField setBackgroundColor:[UIColor whiteColor]]; - textField.borderStyle = UITextBorderStyleLine; - [self addSubview:self.textField]; - } - return self; -} - -- (void)show { - [textField becomeFirstResponder]; - [super show]; -} - -- (NSString *)enteredText { - return textField.text; -} - -- (void)dealloc { - [textField release]; - [super dealloc]; -} - -@end diff --git a/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.h b/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.h index 9c715aaa7c..2c9f391803 100644 --- a/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.h +++ b/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.h @@ -36,7 +36,7 @@ - (UITableViewCell*)createSlider:(NSString*)title min:(float)min max:(float)max default:(float)value; - (UITableViewCell*)createSwitch:(NSString*)title default:(BOOL)state; - (UITableViewCell*)createTriState:(NSString*)title default:(int)index; -- (UITableViewCell*)createTextField:(NSString*)title default:(const char*)value; +- (UITableViewCell*)createTextField:(NSString*)title default:(NSString*)value; - (UITableViewCell*)createList:(NSString*)title default:(NSString*)value; @end diff --git a/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.mm b/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.mm index 46a7b29b7e..29f2c7e9fa 100644 --- a/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.mm +++ b/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.mm @@ -70,22 +70,22 @@ const SkOSMenu::Item* item = menu->getItem(i); NSString* title = [NSString stringWithUTF8String:item->getLabel()]; - int index = 0; - NSArray* optionstrs = nil; if (SkOSMenu::kList_Type == item->getType()) { + int value = 0; SkOptionListItem* List = [[SkOptionListItem alloc] init]; - //List.fCmdID = item->fOSCmd; - //List.getEvent() = item->getEvent(); + List.fItem = item; List.fOptions = [[SkOptionListController alloc] initWithStyle:UITableViewStyleGrouped]; - NSArray* optionstrs = [[NSString stringWithUTF8String:item->getEvent()->findString(SkOSMenu::List_Items_Str)] - componentsSeparatedByString:[NSString stringWithUTF8String:SkOSMenu::Delimiter]]; - for (NSString* optionstr in optionstrs) { - [List.fOptions addOption:optionstr]; - } - item->getEvent()->findS32(item->getSlotName(), &index); - List.fOptions.fSelectedIndex = index; + int count = 0; + SkOSMenu::FindListItemCount(item->getEvent(), &count); + SkString options[count]; + SkOSMenu::FindListItems(item->getEvent(), options); + for (int i = 0; i < count; ++i) + [List.fOptions addOption:[NSString stringWithUTF8String:options[i].c_str()]]; + SkOSMenu::FindListIndex(item->getEvent(), item->getSlotName(), &value); + + List.fOptions.fSelectedIndex = value; List.fCell = [self createList:title default:[List.fOptions getSelectedOption]]; List.fOptions.fParentCell = List.fCell; @@ -95,32 +95,36 @@ else { SkOptionItem* option = [[SkOptionItem alloc] init]; option.fItem = item; + bool state = false; + SkString str; + SkOSMenu::TriState tristate; switch (item->getType()) { case SkOSMenu::kAction_Type: option.fCell = [self createAction:title]; break; case SkOSMenu::kSwitch_Type: - item->getEvent()->findBool(item->getSlotName(), &state); + SkOSMenu::FindSwitchState(item->getEvent(), item->getSlotName(), &state); option.fCell = [self createSwitch:title default:(BOOL)state]; break; case SkOSMenu::kSlider_Type: SkScalar min, max, value; - item->getEvent()->findScalar(SkOSMenu::Slider_Min_Scalar, &min); - item->getEvent()->findScalar(SkOSMenu::Slider_Max_Scalar, &max); - item->getEvent()->findScalar(item->getSlotName(), &value); + SkOSMenu::FindSliderValue(item->getEvent(), item->getSlotName(), &value); + SkOSMenu::FindSliderMin(item->getEvent(), &min); + SkOSMenu::FindSliderMax(item->getEvent(), &max); option.fCell = [self createSlider:title min:min max:max default:value]; break; case SkOSMenu::kTriState_Type: - item->getEvent()->findS32(item->getSlotName(), &index); - option.fCell = [self createTriState:title default:index]; + SkOSMenu::FindTriState(item->getEvent(), item->getSlotName(), &tristate); + option.fCell = [self createTriState:title default:(int)tristate]; break; case SkOSMenu::kTextField_Type: + SkOSMenu::FindText(item->getEvent(), item->getSlotName(), &str); option.fCell = [self createTextField:title - default:item->getEvent()->findString(item->getSlotName())]; + default:[NSString stringWithUTF8String:str.c_str()]]; break; default: break; @@ -225,7 +229,7 @@ } - (UITableViewCell*)createTextField:(NSString*)title - default:(const char*)value { + default:(NSString*)value { UITableViewCell* cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil] autorelease]; @@ -236,7 +240,7 @@ textField.adjustsFontSizeToFitWidth = YES; textField.textAlignment = UITextAlignmentRight; textField.textColor = cell.detailTextLabel.textColor; - textField.placeholder = [NSString stringWithUTF8String:value]; + textField.placeholder = value; textField.returnKeyType = UIReturnKeyDone; [textField addTarget:self action:@selector(valueChanged:) @@ -280,7 +284,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell* cell = [tableView cellForRowAtIndexPath:indexPath]; - id item = [fItems objectAtIndex:indexPath.row]; + id item = [fItems objectAtIndex:[self convertPathToIndex:indexPath]]; if ([item isKindOfClass:[SkOptionListItem class]]) { SkOptionListItem* list = (SkOptionListItem*)item; diff --git a/experimental/iOSSampleApp/Shared/SkUIDetailViewController.mm b/experimental/iOSSampleApp/Shared/SkUIDetailViewController.mm index 95aa88e6cd..f4976b56c4 100644 --- a/experimental/iOSSampleApp/Shared/SkUIDetailViewController.mm +++ b/experimental/iOSSampleApp/Shared/SkUIDetailViewController.mm @@ -1,7 +1,6 @@ #import "SkAlertPrompt.h" #import "SkUIDetailViewController.h" #include "SampleApp.h" -#include "SkApplication.h" #include "SkCGUtils.h" #include "SkData.h" #include "SkOSMenu.h" @@ -19,10 +18,23 @@ [self createButtons]; + UISwipeGestureRecognizer* swipe = [[UISwipeGestureRecognizer alloc] + initWithTarget:self + action:@selector(handleSwipe:)]; + [self.navigationController.navigationBar addGestureRecognizer:swipe]; + [swipe release]; + swipe = [[UISwipeGestureRecognizer alloc] + initWithTarget:self + action:@selector(handleSwipe:)]; + swipe.direction = UISwipeGestureRecognizerDirectionLeft; + [self.navigationController.navigationBar addGestureRecognizer:swipe]; + [swipe release]; + fOptionsController = [[SkOptionsTableViewController alloc] initWithStyle:UITableViewStyleGrouped]; fSkUIView.fOptionsDelegate = fOptionsController; [fOptionsController registerMenus:fWind->getMenus()]; + } - (void)createButtons { @@ -62,6 +74,13 @@ [toolbar release]; } +- (void)handleSwipe:(UISwipeGestureRecognizer *)sender { + if (UISwipeGestureRecognizerDirectionRight == sender.direction) + fWind->previousSample(); + else + fWind->nextSample(); +} + - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; // Overriden to allow auto rotation for any direction } @@ -71,7 +90,6 @@ [fOptionsButton release]; [fPopOverController release]; [fOptionsController release]; - application_term(); [super dealloc]; } diff --git a/experimental/iOSSampleApp/Shared/SkUIView.h b/experimental/iOSSampleApp/Shared/SkUIView.h index 76d660daa0..49f7e16082 100644 --- a/experimental/iOSSampleApp/Shared/SkUIView.h +++ b/experimental/iOSSampleApp/Shared/SkUIView.h @@ -15,7 +15,8 @@ #include "SkMatrix.h" #include "FlingState.h" #include "SampleApp.h" -#include "SkiOSDeviceManager.h" + +class SkiOSDeviceManager; class SkOSWindow; class SkEvent; struct FPSState; @@ -30,7 +31,7 @@ struct FPSState; @interface SkUIView : UIView { BOOL fRedrawRequestPending; - + struct { EAGLContext* fContext; GLuint fRenderbuffer; diff --git a/experimental/iOSSampleApp/Shared/SkUIView.mm b/experimental/iOSSampleApp/Shared/SkUIView.mm index d60763ec23..c6f1e22cd4 100644 --- a/experimental/iOSSampleApp/Shared/SkUIView.mm +++ b/experimental/iOSSampleApp/Shared/SkUIView.mm @@ -15,71 +15,82 @@ #include "GrGLInterface.h" #include "SkGpuDevice.h" #include "SkCGUtils.h" - -SkiOSDeviceManager::SkiOSDeviceManager() { - fGrContext = NULL; - fGrRenderTarget = NULL; - usingGL = false; -} - -SkiOSDeviceManager::~SkiOSDeviceManager() { - SkSafeUnref(fGrContext); - SkSafeUnref(fGrRenderTarget); -} - -void SkiOSDeviceManager::init(SampleWindow* win) { - win->attachGL(); - if (NULL == fGrContext) { +class SkiOSDeviceManager : public SampleWindow::DeviceManager { +public: + SkiOSDeviceManager() { + fGrContext = NULL; + fGrRenderTarget = NULL; + usingGL = false; + } + virtual ~SkiOSDeviceManager() { + SkSafeUnref(fGrContext); + SkSafeUnref(fGrRenderTarget); + } + + virtual void init(SampleWindow* win) { + win->attachGL(); + if (NULL == fGrContext) { #ifdef USE_GL_1 - fGrContext = GrContext::Create(kOpenGL_Fixed_GrEngine, NULL); + fGrContext = GrContext::Create(kOpenGL_Fixed_GrEngine, NULL); #else - fGrContext = GrContext::Create(kOpenGL_Shaders_GrEngine, NULL); + fGrContext = GrContext::Create(kOpenGL_Shaders_GrEngine, NULL); #endif + } + fGrRenderTarget = SkGpuDevice::Current3DApiRenderTarget(); + if (NULL == fGrContext) { + SkDebugf("Failed to setup 3D"); + win->detachGL(); + } + } + + virtual bool supportsDeviceType(SampleWindow::DeviceType dType) { + switch (dType) { + case SampleWindow::kRaster_DeviceType: + case SampleWindow::kPicture_DeviceType: // fallthru + return true; + case SampleWindow::kGPU_DeviceType: + return NULL != fGrContext; + default: + return false; + } } - fGrRenderTarget = SkGpuDevice::Current3DApiRenderTarget(); - if (NULL == fGrContext) { - SkDebugf("Failed to setup 3D"); - win->detachGL(); - } -} -bool SkiOSDeviceManager::supportsDeviceType(SampleWindow::DeviceType dType) { - switch (dType) { - case SampleWindow::kRaster_DeviceType: - case SampleWindow::kPicture_DeviceType: // fallthru - return true; - case SampleWindow::kGPU_DeviceType: - return NULL != fGrContext; - default: - return false; - } -} -bool SkiOSDeviceManager::prepareCanvas(SampleWindow::DeviceType dType, - SkCanvas* canvas, - SampleWindow* win) { - if (SampleWindow::kGPU_DeviceType == dType) { - canvas->setDevice(new SkGpuDevice(fGrContext, fGrRenderTarget))->unref(); - usingGL = true; - } - else { - //The clip needs to be applied with a device attached to the canvas - canvas->setBitmapDevice(win->getBitmap()); - usingGL = false; - } - return true; -} - -void SkiOSDeviceManager::publishCanvas(SampleWindow::DeviceType dType, - SkCanvas* canvas, - SampleWindow* win) { - if (SampleWindow::kGPU_DeviceType == dType) { - fGrContext->flush(); + virtual bool prepareCanvas(SampleWindow::DeviceType dType, + SkCanvas* canvas, + SampleWindow* win) { + if (SampleWindow::kGPU_DeviceType == dType) { + canvas->setDevice(new SkGpuDevice(fGrContext, fGrRenderTarget))->unref(); + usingGL = true; + } + else { + //The clip needs to be applied with a device attached to the canvas + canvas->setBitmapDevice(win->getBitmap()); + usingGL = false; + } + return true; } - else { - //CGContextRef cg = UIGraphicsGetCurrentContext(); - //SkCGDrawBitmap(cg, win->getBitmap(), 0, 0); + virtual void publishCanvas(SampleWindow::DeviceType dType, + SkCanvas* canvas, + SampleWindow* win) { + if (SampleWindow::kGPU_DeviceType == dType) { + fGrContext->flush(); + } + else { + //CGContextRef cg = UIGraphicsGetCurrentContext(); + //SkCGDrawBitmap(cg, win->getBitmap(), 0, 0); + } + win->presentGL(); } - win->presentGL(); -} + + virtual void windowSizeChanged(SampleWindow* win) {} + + bool isUsingGL() { return usingGL; } + + virtual GrContext* getGrContext() { return fGrContext; } +private: + bool usingGL; + GrContext* fGrContext; + GrRenderTarget* fGrRenderTarget; +}; //////////////////////////////////////////////////////////////////////////////// @implementation SkUIView @@ -90,17 +101,8 @@ void SkiOSDeviceManager::publishCanvas(SampleWindow::DeviceType dType, #include "SkEvent.h" #include "SkWindow.h" -static float gScreenScale = 1; - #define kREDRAW_UIVIEW_GL "sk_redraw_uiview_gl_iOS" -static const float SCALE_FOR_ZOOM_LENS = 4.0; -#define Y_OFFSET_FOR_ZOOM_LENS 200 -#define SIZE_FOR_ZOOM_LENS 250 - -static const float MAX_ZOOM_SCALE = 4.0; -static const float MIN_ZOOM_SCALE = 2.0 / MAX_ZOOM_SCALE; - extern bool gDoTraceDraw; #define DO_TRACE_DRAW_MAX 100 @@ -171,6 +173,16 @@ static FPSState gFPS; - (id)initWithMyDefaults { fRedrawRequestPending = false; fFPSState = new FPSState; + + //Add gesture recognizer for single taps. Taps on the right half of the view + //will cause SampleApp to go to the next sample, taps on the left will go to + //the previous sample + UITapGestureRecognizer* tap = [[UITapGestureRecognizer alloc] + initWithTarget:self + action:@selector(handleTap:)]; + [self addGestureRecognizer:tap]; + [tap release]; + #ifdef USE_GL_1 fGL.fContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; #else @@ -227,6 +239,7 @@ static FPSState gFPS; fWind = new SampleWindow(self, NULL, NULL, fDevManager); application_init(); fWind->resize(self.frame.size.width, self.frame.size.height, SKWIND_CONFIG); + return self; } @@ -258,11 +271,6 @@ static FPSState gFPS; - (void)layoutSubviews { int W, H; - gScreenScale = [UIScreen mainScreen].scale; - - if ([self respondsToSelector:@selector(setContentScaleFactor:)]) { - self.contentScaleFactor = gScreenScale; - } // Allocate color buffer backing based on the current layer size glBindRenderbuffer(GL_RENDERBUFFER, fGL.fRenderbuffer); @@ -400,6 +408,15 @@ static FPSState gFPS; } } +- (void)handleTap:(UISwipeGestureRecognizer *)sender { +// CGPoint loc = [sender locationInView:self]; +// if (loc.x > self.bounds.size.width/2) +// ((SampleWindow*)fWind)->nextSample(); +// else +// ((SampleWindow*)fWind)->previousSample(); +} + + /////////////////////////////////////////////////////////////////////////////// - (void)setSkTitle:(const char *)title { diff --git a/experimental/iOSSampleApp/Shared/SkiOSDeviceManager.h b/experimental/iOSSampleApp/Shared/SkiOSDeviceManager.h deleted file mode 100644 index da4975cd25..0000000000 --- a/experimental/iOSSampleApp/Shared/SkiOSDeviceManager.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef SkiOSDeviceManager_DEFINED -#define SkiOSDeviceManager_DEFINED -#include "SampleApp.h" -#include "SkCanvas.h" -#include "GrContext.h" -#include "GrGLInterface.h" -#include "SkGpuDevice.h" -#include "SkCGUtils.h" -#include "GrContext.h" -class SkiOSDeviceManager : public SampleWindow::DeviceManager { -public: - SkiOSDeviceManager(); - virtual ~SkiOSDeviceManager(); - - virtual void init(SampleWindow* win); - - virtual bool supportsDeviceType(SampleWindow::DeviceType dType); - virtual bool prepareCanvas(SampleWindow::DeviceType dType, - SkCanvas* canvas, - SampleWindow* win); - virtual void publishCanvas(SampleWindow::DeviceType dType, - SkCanvas* canvas, - SampleWindow* win); - - virtual void windowSizeChanged(SampleWindow* win) {} - - bool isUsingGL() { return usingGL; } - - virtual GrContext* getGrContext() { return fGrContext; } -private: - bool usingGL; - GrContext* fGrContext; - GrRenderTarget* fGrRenderTarget; -}; - -#endif
\ No newline at end of file diff --git a/experimental/iOSSampleApp/iOSSampleApp.xcodeproj/project.pbxproj b/experimental/iOSSampleApp/iOSSampleApp.xcodeproj/project.pbxproj index 5911c623eb..d1fcab1ab7 100755 --- a/experimental/iOSSampleApp/iOSSampleApp.xcodeproj/project.pbxproj +++ b/experimental/iOSSampleApp/iOSSampleApp.xcodeproj/project.pbxproj @@ -429,23 +429,25 @@ 260EF18513AFD62E0064D447 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 260EF18413AFD62E0064D447 /* CoreText.framework */; }; 260EF2B013AFDBD30064D447 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 263BE75813CCC7BF00CCE991 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 263BE75713CCC7BF00CCE991 /* QuartzCore.framework */; }; + 26591EB913EB16EB000DA8A8 /* TransitionView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26591EB813EB16EB000DA8A8 /* TransitionView.cpp */; }; 265C7DE313D75752008329F6 /* SkOptionListController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 265C7DE213D75752008329F6 /* SkOptionListController.mm */; }; - 265C816C13D77860008329F6 /* SampleDrawingClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 265C816A13D77860008329F6 /* SampleDrawingClient.cpp */; }; 2662AB7013BD067900CDE7E9 /* SkiOSSampleApp-Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 2662AB6F13BD067900CDE7E9 /* SkiOSSampleApp-Debug.xcconfig */; }; 2662AB7613BD0C0D00CDE7E9 /* SkiOSSampleApp-Release.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 2662AB7513BD0C0D00CDE7E9 /* SkiOSSampleApp-Release.xcconfig */; }; 2662AB7813BD0C1E00CDE7E9 /* SkiOSSampleApp-Base.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 2662AB7713BD0C1E00CDE7E9 /* SkiOSSampleApp-Base.xcconfig */; }; 2663AC9413D5D8D400C20488 /* SkOptionsTableViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2663AC9313D5D8D400C20488 /* SkOptionsTableViewController.mm */; }; 26677D6613B4C548009319B8 /* SkData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26677D6513B4C548009319B8 /* SkData.cpp */; }; 26811E7913DEFAE8001A1609 /* SkBitSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26811E7813DEFAE8001A1609 /* SkBitSet.cpp */; }; - 26811E8613DEFC33001A1609 /* SampleDrawingServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 265C816B13D77860008329F6 /* SampleDrawingServer.cpp */; }; - 268F31FE13CDE72D003A1EF2 /* SkSockets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268F31FA13CDE726003A1EF2 /* SkSockets.cpp */; }; + 268C50D613F022820003FF9A /* SkColorPalette.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268C50D213F022820003FF9A /* SkColorPalette.cpp */; }; + 268C50D713F022820003FF9A /* SkNetPipeController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268C50D413F022820003FF9A /* SkNetPipeController.cpp */; }; + 268C50DA13F022AF0003FF9A /* SampleDrawingClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268C50D813F022AF0003FF9A /* SampleDrawingClient.cpp */; }; + 268C50DB13F022AF0003FF9A /* SampleDrawingServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268C50D913F022AF0003FF9A /* SampleDrawingServer.cpp */; }; + 268C50DF13F0230C0003FF9A /* SampleNetPipeReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268C50DC13F0230C0003FF9A /* SampleNetPipeReader.cpp */; }; + 268C50E013F0230C0003FF9A /* SkSockets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268C50DD13F0230C0003FF9A /* SkSockets.cpp */; }; 26962B2313CDF6A00039B1FB /* SkOSFile_iOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 260EE8BB13AFA7790064D447 /* SkOSFile_iOS.mm */; }; 26962C8013CE256E0039B1FB /* SkUIDetailViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26962C7913CE256E0039B1FB /* SkUIDetailViewController.mm */; }; 26962C8113CE256E0039B1FB /* SkUIRootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26962C7B13CE256E0039B1FB /* SkUIRootViewController.mm */; }; 26962CA413CE265C0039B1FB /* SkOSWindow_iOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26962CA313CE265C0039B1FB /* SkOSWindow_iOS.mm */; }; 26962CAB13CE268A0039B1FB /* SampleApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26962CA913CE268A0039B1FB /* SampleApp.cpp */; }; - 26962CEC13CE293A0039B1FB /* SkColorPalette.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26962CE813CE293A0039B1FB /* SkColorPalette.cpp */; }; - 26962CED13CE293A0039B1FB /* SkNetPipeController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26962CEA13CE293A0039B1FB /* SkNetPipeController.cpp */; }; 26962D4F13CE2D780039B1FB /* GrGLDefaultInterface_iOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26962D4E13CE2D780039B1FB /* GrGLDefaultInterface_iOS.cpp */; }; 26A8AFF313E05D7000A3C111 /* GrResourceCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A8AFF113E05D7000A3C111 /* GrResourceCache.cpp */; }; 26E0E40A13B4E67800866555 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 260EE9D113AFA7850064D447 /* OpenGLES.framework */; }; @@ -1325,10 +1327,9 @@ 260EE9D113AFA7850064D447 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 260EF18413AFD62E0064D447 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; }; 263BE75713CCC7BF00CCE991 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 26591EB813EB16EB000DA8A8 /* TransitionView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransitionView.cpp; sourceTree = "<group>"; }; 265C7DE113D75752008329F6 /* SkOptionListController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkOptionListController.h; path = Shared/SkOptionListController.h; sourceTree = "<group>"; }; 265C7DE213D75752008329F6 /* SkOptionListController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SkOptionListController.mm; path = Shared/SkOptionListController.mm; sourceTree = "<group>"; }; - 265C816A13D77860008329F6 /* SampleDrawingClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SampleDrawingClient.cpp; sourceTree = "<group>"; }; - 265C816B13D77860008329F6 /* SampleDrawingServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SampleDrawingServer.cpp; sourceTree = "<group>"; }; 2662AB6F13BD067900CDE7E9 /* SkiOSSampleApp-Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "SkiOSSampleApp-Debug.xcconfig"; sourceTree = "<group>"; }; 2662AB7513BD0C0D00CDE7E9 /* SkiOSSampleApp-Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "SkiOSSampleApp-Release.xcconfig"; sourceTree = "<group>"; }; 2662AB7713BD0C1E00CDE7E9 /* SkiOSSampleApp-Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "SkiOSSampleApp-Base.xcconfig"; sourceTree = "<group>"; }; @@ -1336,11 +1337,17 @@ 2663AC9313D5D8D400C20488 /* SkOptionsTableViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SkOptionsTableViewController.mm; path = Shared/SkOptionsTableViewController.mm; sourceTree = "<group>"; }; 26677D6413B4C53E009319B8 /* SkData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkData.h; path = core/SkData.h; sourceTree = "<group>"; }; 26677D6513B4C548009319B8 /* SkData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkData.cpp; path = core/SkData.cpp; sourceTree = "<group>"; }; - 266CB66113CF56E30011139A /* SkiOSDeviceManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkiOSDeviceManager.h; path = Shared/SkiOSDeviceManager.h; sourceTree = "<group>"; }; 26811E7813DEFAE8001A1609 /* SkBitSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkBitSet.cpp; path = ../../src/pdf/SkBitSet.cpp; sourceTree = SOURCE_ROOT; }; 26811E7A13DEFAF7001A1609 /* SkBitSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkBitSet.h; path = ../../include/pdf/SkBitSet.h; sourceTree = SOURCE_ROOT; }; - 268F31FA13CDE726003A1EF2 /* SkSockets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkSockets.cpp; path = ../SkSockets.cpp; sourceTree = "<group>"; }; - 268F31FB13CDE726003A1EF2 /* SkSockets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkSockets.h; path = ../SkSockets.h; sourceTree = "<group>"; }; + 268C50D213F022820003FF9A /* SkColorPalette.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkColorPalette.cpp; path = ../DrawingBoard/SkColorPalette.cpp; sourceTree = SOURCE_ROOT; }; + 268C50D313F022820003FF9A /* SkColorPalette.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkColorPalette.h; path = ../DrawingBoard/SkColorPalette.h; sourceTree = SOURCE_ROOT; }; + 268C50D413F022820003FF9A /* SkNetPipeController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkNetPipeController.cpp; path = ../DrawingBoard/SkNetPipeController.cpp; sourceTree = SOURCE_ROOT; }; + 268C50D513F022820003FF9A /* SkNetPipeController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkNetPipeController.h; path = ../DrawingBoard/SkNetPipeController.h; sourceTree = SOURCE_ROOT; }; + 268C50D813F022AF0003FF9A /* SampleDrawingClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SampleDrawingClient.cpp; path = ../DrawingBoard/SampleDrawingClient.cpp; sourceTree = SOURCE_ROOT; }; + 268C50D913F022AF0003FF9A /* SampleDrawingServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SampleDrawingServer.cpp; path = ../DrawingBoard/SampleDrawingServer.cpp; sourceTree = SOURCE_ROOT; }; + 268C50DC13F0230C0003FF9A /* SampleNetPipeReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SampleNetPipeReader.cpp; path = ../Networking/SampleNetPipeReader.cpp; sourceTree = SOURCE_ROOT; }; + 268C50DD13F0230C0003FF9A /* SkSockets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkSockets.cpp; path = ../Networking/SkSockets.cpp; sourceTree = SOURCE_ROOT; }; + 268C50DE13F0230C0003FF9A /* SkSockets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkSockets.h; path = ../Networking/SkSockets.h; sourceTree = SOURCE_ROOT; }; 26962C7813CE256E0039B1FB /* SkUIDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkUIDetailViewController.h; path = Shared/SkUIDetailViewController.h; sourceTree = "<group>"; }; 26962C7913CE256E0039B1FB /* SkUIDetailViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SkUIDetailViewController.mm; path = Shared/SkUIDetailViewController.mm; sourceTree = "<group>"; }; 26962C7A13CE256E0039B1FB /* SkUIRootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkUIRootViewController.h; path = Shared/SkUIRootViewController.h; sourceTree = "<group>"; }; @@ -1351,10 +1358,6 @@ 26962CA513CE26730039B1FB /* SkOSWindow_iOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkOSWindow_iOS.h; path = ../../include/views/SkOSWindow_iOS.h; sourceTree = SOURCE_ROOT; }; 26962CA913CE268A0039B1FB /* SampleApp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SampleApp.cpp; path = ../../samplecode/SampleApp.cpp; sourceTree = SOURCE_ROOT; }; 26962CAA13CE268A0039B1FB /* SampleApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SampleApp.h; path = ../../samplecode/SampleApp.h; sourceTree = SOURCE_ROOT; }; - 26962CE813CE293A0039B1FB /* SkColorPalette.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkColorPalette.cpp; path = Shared/DrawingBoard/SkColorPalette.cpp; sourceTree = "<group>"; }; - 26962CE913CE293A0039B1FB /* SkColorPalette.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkColorPalette.h; path = Shared/DrawingBoard/SkColorPalette.h; sourceTree = "<group>"; }; - 26962CEA13CE293A0039B1FB /* SkNetPipeController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkNetPipeController.cpp; path = Shared/DrawingBoard/SkNetPipeController.cpp; sourceTree = "<group>"; }; - 26962CEB13CE293A0039B1FB /* SkNetPipeController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkNetPipeController.h; path = Shared/DrawingBoard/SkNetPipeController.h; sourceTree = "<group>"; }; 26962D4E13CE2D780039B1FB /* GrGLDefaultInterface_iOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GrGLDefaultInterface_iOS.cpp; path = ../../gpu/src/ios/GrGLDefaultInterface_iOS.cpp; sourceTree = SOURCE_ROOT; }; 26A8AFF113E05D7000A3C111 /* GrResourceCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GrResourceCache.cpp; sourceTree = "<group>"; }; 26A8AFF213E05D7000A3C111 /* GrResourceCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GrResourceCache.h; sourceTree = "<group>"; }; @@ -1456,8 +1459,7 @@ 260E002313B11F5B0064D447 /* samplecode */ = { isa = PBXGroup; children = ( - 265C816A13D77860008329F6 /* SampleDrawingClient.cpp */, - 265C816B13D77860008329F6 /* SampleDrawingServer.cpp */, + 26591EB813EB16EB000DA8A8 /* TransitionView.cpp */, 260E002413B11F5B0064D447 /* ClockFaceView.cpp */, 260E002513B11F5B0064D447 /* OverView.cpp */, 260E002613B11F5B0064D447 /* SampleAARects.cpp */, @@ -2715,7 +2717,6 @@ children = ( 26FB98D113D0C87000ACBEA0 /* SkUIView.h */, 26FB98D213D0C87000ACBEA0 /* SkUIView.mm */, - 266CB66113CF56E30011139A /* SkiOSDeviceManager.h */, 26962D4E13CE2D780039B1FB /* GrGLDefaultInterface_iOS.cpp */, 26962CA513CE26730039B1FB /* SkOSWindow_iOS.h */, 26962CA313CE265C0039B1FB /* SkOSWindow_iOS.mm */, @@ -2740,10 +2741,12 @@ 26962CE713CE29120039B1FB /* DrawingBoard */ = { isa = PBXGroup; children = ( - 26962CE813CE293A0039B1FB /* SkColorPalette.cpp */, - 26962CE913CE293A0039B1FB /* SkColorPalette.h */, - 26962CEA13CE293A0039B1FB /* SkNetPipeController.cpp */, - 26962CEB13CE293A0039B1FB /* SkNetPipeController.h */, + 268C50D813F022AF0003FF9A /* SampleDrawingClient.cpp */, + 268C50D913F022AF0003FF9A /* SampleDrawingServer.cpp */, + 268C50D213F022820003FF9A /* SkColorPalette.cpp */, + 268C50D313F022820003FF9A /* SkColorPalette.h */, + 268C50D413F022820003FF9A /* SkNetPipeController.cpp */, + 268C50D513F022820003FF9A /* SkNetPipeController.h */, ); name = DrawingBoard; sourceTree = "<group>"; @@ -2751,8 +2754,9 @@ 26F67B2A13CB3564005DDCD2 /* Networking */ = { isa = PBXGroup; children = ( - 268F31FA13CDE726003A1EF2 /* SkSockets.cpp */, - 268F31FB13CDE726003A1EF2 /* SkSockets.h */, + 268C50DC13F0230C0003FF9A /* SampleNetPipeReader.cpp */, + 268C50DD13F0230C0003FF9A /* SkSockets.cpp */, + 268C50DE13F0230C0003FF9A /* SkSockets.h */, ); name = Networking; sourceTree = "<group>"; @@ -3339,27 +3343,29 @@ 26F548E913B91980007CC564 /* SkBitmapProcState_opts_arm.cpp in Sources */, 26F548EC13B91980007CC564 /* SkBlitRow_opts_none.cpp in Sources */, 26F548ED13B91980007CC564 /* SkUtils_opts_none.cpp in Sources */, - 268F31FE13CDE72D003A1EF2 /* SkSockets.cpp in Sources */, 26962B2313CDF6A00039B1FB /* SkOSFile_iOS.mm in Sources */, 26962C8013CE256E0039B1FB /* SkUIDetailViewController.mm in Sources */, 26962C8113CE256E0039B1FB /* SkUIRootViewController.mm in Sources */, 26962CA413CE265C0039B1FB /* SkOSWindow_iOS.mm in Sources */, 26962CAB13CE268A0039B1FB /* SampleApp.cpp in Sources */, - 26962CEC13CE293A0039B1FB /* SkColorPalette.cpp in Sources */, - 26962CED13CE293A0039B1FB /* SkNetPipeController.cpp in Sources */, 26962D4F13CE2D780039B1FB /* GrGLDefaultInterface_iOS.cpp in Sources */, 26FB98D313D0C87000ACBEA0 /* SkUIView.mm in Sources */, 2663AC9413D5D8D400C20488 /* SkOptionsTableViewController.mm in Sources */, 265C7DE313D75752008329F6 /* SkOptionListController.mm in Sources */, - 265C816C13D77860008329F6 /* SampleDrawingClient.cpp in Sources */, 26811E7913DEFAE8001A1609 /* SkBitSet.cpp in Sources */, - 26811E8613DEFC33001A1609 /* SampleDrawingServer.cpp in Sources */, 26A8AFF313E05D7000A3C111 /* GrResourceCache.cpp in Sources */, 26FB125E13E70310001AFF6D /* SkEventNotifier.mm in Sources */, 26FB129313E704AE001AFF6D /* GrGLTexture.cpp in Sources */, 26FB129413E704B0001AFF6D /* GrContext.cpp in Sources */, 26FB12B013E70D3B001AFF6D /* GrGLRenderTarget.cpp in Sources */, 26FB12B413E70D51001AFF6D /* GrRenderTarget.cpp in Sources */, + 26591EB913EB16EB000DA8A8 /* TransitionView.cpp in Sources */, + 268C50D613F022820003FF9A /* SkColorPalette.cpp in Sources */, + 268C50D713F022820003FF9A /* SkNetPipeController.cpp in Sources */, + 268C50DA13F022AF0003FF9A /* SampleDrawingClient.cpp in Sources */, + 268C50DB13F022AF0003FF9A /* SampleDrawingServer.cpp in Sources */, + 268C50DF13F0230C0003FF9A /* SampleNetPipeReader.cpp in Sources */, + 268C50E013F0230C0003FF9A /* SkSockets.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3397,7 +3403,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 2662AB6F13BD067900CDE7E9 /* SkiOSSampleApp-Debug.xcconfig */; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_C_LANGUAGE_STANDARD = c99; GCC_OPTIMIZATION_LEVEL = 0; |