diff options
author | maf@google.com <maf@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-13 23:17:37 +0000 |
---|---|---|
committer | maf@google.com <maf@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-13 23:17:37 +0000 |
commit | fb8d32aab3a33166d3c1814e295eeafbea97174b (patch) | |
tree | 333cebe6d64ed3edb2fc5a3d7ef03fe8f5dec1b1 /o3d | |
parent | ebe89e0676c12a6ebccb35fef1611323d1b35afb (diff) | |
download | chromium_src-fb8d32aab3a33166d3c1814e295eeafbea97174b.zip chromium_src-fb8d32aab3a33166d3c1814e295eeafbea97174b.tar.gz chromium_src-fb8d32aab3a33166d3c1814e295eeafbea97174b.tar.bz2 |
Changes needed to get Mac plugin gyp project build compiling and linking.
Review URL: http://codereview.chromium.org/165433
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23375 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r-- | o3d/build/common.gypi | 3 | ||||
-rw-r--r-- | o3d/build/libs.gyp | 6 | ||||
-rw-r--r-- | o3d/plugin/cross/async_loading.cc | 1 | ||||
-rw-r--r-- | o3d/plugin/cross/main.cc | 6 | ||||
-rw-r--r-- | o3d/plugin/cross/np_v8_bridge.cc | 3 | ||||
-rw-r--r-- | o3d/plugin/mac/config_mac.mm | 3 | ||||
-rw-r--r-- | o3d/plugin/mac/main_mac.mm | 4 | ||||
-rw-r--r-- | o3d/plugin/mac/plugin_mac.mm | 48 | ||||
-rw-r--r-- | o3d/plugin/plugin.gyp | 14 |
9 files changed, 58 insertions, 30 deletions
diff --git a/o3d/build/common.gypi b/o3d/build/common.gypi index 1883836..ef49a52 100644 --- a/o3d/build/common.gypi +++ b/o3d/build/common.gypi @@ -68,11 +68,12 @@ 'SK_BUILD_FOR_MAC', ], 'xcode_settings': { + 'WARNING_CFLAGS': ['-Wno-deprecated-declarations'], 'CFLAGS': ['-gstabs+', '-fno-eliminate-unused-debug-symbols', '-mmacosx-version-min=10.4'], 'WARNING_CXXFLAGS': ['-Wstrict-aliasing', - '-Wno-deprecated'], + '-Wno-deprecated',], }, }, }, diff --git a/o3d/build/libs.gyp b/o3d/build/libs.gyp index 43daadb..88dba6b 100644 --- a/o3d/build/libs.gyp +++ b/o3d/build/libs.gyp @@ -19,6 +19,12 @@ { 'destination': '<(PRODUCT_DIR)', 'conditions' : [ + [ 'OS=="mac"', + { + 'files': [ + ], + }, + ], [ 'OS=="win"', { 'files': [ diff --git a/o3d/plugin/cross/async_loading.cc b/o3d/plugin/cross/async_loading.cc index dfcbcfe..e0f577f 100644 --- a/o3d/plugin/cross/async_loading.cc +++ b/o3d/plugin/cross/async_loading.cc @@ -228,7 +228,6 @@ void userglue_method_send(void *plugin_data, PluginObject *plugin_object = static_cast<PluginObject *>(plugin_data); StreamManager *stream_manager = plugin_object->stream_manager(); StreamManager::FinishedCallback *callback = NULL; - bool result = false; if (request->done()) { request->set_success(false); diff --git a/o3d/plugin/cross/main.cc b/o3d/plugin/cross/main.cc index da16756..1d33da5 100644 --- a/o3d/plugin/cross/main.cc +++ b/o3d/plugin/cross/main.cc @@ -49,10 +49,10 @@ namespace o3d { NPError NP_GetValue(void *instance, NPPVariable variable, void *value) { switch (variable) { case NPPVpluginNameString: - *static_cast<char **>(value) = O3D_PLUGIN_NAME; + *static_cast<char **>(value) = const_cast<char*>(O3D_PLUGIN_NAME); break; case NPPVpluginDescriptionString: - *static_cast<char **>(value) = O3D_PLUGIN_DESCRIPTION; + *static_cast<char **>(value) = const_cast<char*>(O3D_PLUGIN_DESCRIPTION); break; default: return NPERR_INVALID_PARAM; @@ -170,7 +170,7 @@ NPError EXPORT_SYMBOL OSCALL NP_GetEntryPoints(NPPluginFuncs *pluginFuncs) { } char * EXPORT_SYMBOL NP_GetMIMEDescription(void) { - return O3D_PLUGIN_MIME_TYPE "::O3D MIME"; + return const_cast<char*>(O3D_PLUGIN_MIME_TYPE "::O3D MIME"); } } // namespace o3d / extern "C" diff --git a/o3d/plugin/cross/np_v8_bridge.cc b/o3d/plugin/cross/np_v8_bridge.cc index e36b9d8..2acdfd8 100644 --- a/o3d/plugin/cross/np_v8_bridge.cc +++ b/o3d/plugin/cross/np_v8_bridge.cc @@ -484,7 +484,8 @@ class NPV8Object : public NPObject { // Due to a bug in Chrome, need to filter out any properties that // are functions. See comment in HasProperty. int num_non_function_properties = 0; - for (int i = 0; i != v8_names->Length(); ++i) { + int length = v8_names->Length(); + for (int i = 0; i < length; ++i) { Local<Value> v8_property_value = v8_object->Get(v8_names->Get(Int32::New(i))); if (!v8_property_value->IsFunction()) { diff --git a/o3d/plugin/mac/config_mac.mm b/o3d/plugin/mac/config_mac.mm index 96701df..ec304da 100644 --- a/o3d/plugin/mac/config_mac.mm +++ b/o3d/plugin/mac/config_mac.mm @@ -174,7 +174,8 @@ bool UseSoftwareRenderer() { NULL); use_software_renderer = false; - for (int i = 0; i < arraysize(softwareRenderList); ++i) { + int list_count = arraysize(softwareRenderList); + for (int i = 0; i < list_count; ++i) { GPUInfo &softwareRenderInfo = softwareRenderList[i]; if (vendorID == softwareRenderInfo.vendorID && deviceID == softwareRenderInfo.deviceID) { diff --git a/o3d/plugin/mac/main_mac.mm b/o3d/plugin/mac/main_mac.mm index ac47bb0..5ec0777 100644 --- a/o3d/plugin/mac/main_mac.mm +++ b/o3d/plugin/mac/main_mac.mm @@ -530,7 +530,7 @@ NPError InitializePlugin() { // Cannot actually fail - void Mac_SetBestEventModel(NPP instance, PluginObject* obj) { NPError err = NPERR_NO_ERROR; - NPEventModel event_model = NPEventModelCarbon; + NPEventModel model_to_use = NPEventModelCarbon; NPBool supportsCocoaEventModel = FALSE; NPBool supportsCarbonEventModel = FALSE; @@ -566,7 +566,7 @@ void Mac_SetBestEventModel(NPP instance, PluginObject* obj) { // Cocoa event model spec does not supply sufficient window // information in its Cocoa NPP_SetWindow calls for us to bind an // AGL context to the browser window. - NPEventModel model_to_use = + model_to_use = (supportsCarbonEventModel) ? NPEventModelCarbon : NPEventModelCocoa; NPN_SetValue(instance, NPPVpluginEventModel, reinterpret_cast<void*>(model_to_use)); diff --git a/o3d/plugin/mac/plugin_mac.mm b/o3d/plugin/mac/plugin_mac.mm index 0c46fe3..f04955d 100644 --- a/o3d/plugin/mac/plugin_mac.mm +++ b/o3d/plugin/mac/plugin_mac.mm @@ -213,7 +213,8 @@ void RenderTimer::RemoveInstance(NPP instance) { void RenderTimer::TimerCallback(CFRunLoopTimerRef timer, void* info) { HANDLE_CRASHES; - for (int i = 0; i < instances_.size(); ++i) { + int instance_count = instances_.size(); + for (int i = 0; i < instance_count; ++i) { NPP instance = instances_[i]; PluginObject* obj = static_cast<PluginObject*>(instance->pdata); @@ -383,10 +384,7 @@ static UniChar * GetFullscreenDisplayText(int *returned_length) { static void DrawToOverlayWindow(WindowRef overlayWindow) { CGContextRef overlayContext = NULL; - OSStatus result = noErr; CGFloat kWhiteOpaque[] = {1.0, 1.0, 1.0, 1.0}; - CGFloat kBlackOpaque[] = {0.0, 0.0, 0.0, 1.0}; - CGFloat kGreyNotOpaque[] = {0.5, 0.5, 0.5, 0.5}; CGFloat kBlackNotOpaque[] = {0.0, 0.0, 0.0, 0.5}; Rect bounds = {0, 0, 0, 0}; const char* kOverlayWindowFontName = "Arial"; @@ -536,8 +534,8 @@ static WindowRef CreateOverlayWindow(void) { kWindowNoActivatesAttribute | kWindowStandardHandlerAttribute; EventTypeSpec eventTypes[] = { - kEventClassWindow, kEventWindowPaint, - kEventClassWindow, kEventWindowShown + {kEventClassWindow, kEventWindowPaint}, + {kEventClassWindow, kEventWindowShown} }; err = CreateNewWindow(wClass, @@ -592,7 +590,6 @@ o3d::Event::Button MacOSMouseButtonNumberToO3DButton(int inButton) { static OSStatus HandleFullscreenWindow(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) { - OSStatus err = noErr; OSType event_class = GetEventClass(inEvent); OSType event_kind = GetEventKind(inEvent); NPP instance = (NPP)inUserData; @@ -717,6 +714,7 @@ static OSStatus HandleFullscreenWindow(EventHandlerCallRef inHandlerCallRef, return eventNotHandledErr; } } + return noErr; } @@ -726,15 +724,15 @@ static WindowRef CreateFullscreenWindow(WindowRef window, Rect bounds = CGRect2Rect(CGDisplayBounds(CGMainDisplayID())); OSStatus err = noErr; EventTypeSpec eventTypes[] = { - kEventClassKeyboard, kEventRawKeyDown, - kEventClassKeyboard, kEventRawKeyRepeat, - kEventClassKeyboard, kEventRawKeyUp, - kEventClassMouse, kEventMouseDown, - kEventClassMouse, kEventMouseUp, - kEventClassMouse, kEventMouseMoved, - kEventClassMouse, kEventMouseDragged, - kEventClassMouse, kEventMouseScroll, - kEventClassMouse, kEventMouseWheelMoved + {kEventClassKeyboard, kEventRawKeyDown}, + {kEventClassKeyboard, kEventRawKeyRepeat}, + {kEventClassKeyboard, kEventRawKeyUp}, + {kEventClassMouse, kEventMouseDown}, + {kEventClassMouse, kEventMouseUp}, + {kEventClassMouse, kEventMouseMoved}, + {kEventClassMouse, kEventMouseDragged}, + {kEventClassMouse, kEventMouseScroll}, + {kEventClassMouse, kEventMouseWheelMoved} }; if (window == NULL) @@ -874,6 +872,10 @@ static void GetCurrentDisplayMode(o3d::DisplayMode *mode) { } + +} // namespace o3d + + bool PluginObject::GetDisplayMode(int id, o3d::DisplayMode *mode) { if (id == o3d::Renderer::DISPLAY_MODE_DEFAULT) { GetCurrentDisplayMode(mode); @@ -896,10 +898,10 @@ void PluginObject::GetDisplayModes(std::vector<o3d::DisplayMode> *modes) { int bpp = 0; if (o3d::ExtractDisplayModeData([mac_modes objectAtIndex:i], - &width, - &height, - &refresh_rate, - &bpp) && bpp == 32) + &width, + &height, + &refresh_rate, + &bpp) && bpp == 32) modes_found.push_back(o3d::DisplayMode(width, height, refresh_rate, i + o3d::kO3D_MODE_OFFSET)); } @@ -912,6 +914,9 @@ void PluginObject::GetDisplayModes(std::vector<o3d::DisplayMode> *modes) { #define kTransitionTime 1.0 +namespace glue { +namespace _o3d { + bool PluginObject::RequestFullscreenDisplay() { // If already in fullscreen mode, do nothing. if (GetFullscreenMacWindow()) @@ -943,7 +948,7 @@ bool PluginObject::RequestFullscreenDisplay() { short short_target_width = target_width; short short_target_height = target_height; BeginFullScreen(&mac_fullscreen_state_, - GetMainDevice(), + nil, // Value of nil selects the main screen. &short_target_width, &short_target_height, &fullscreen_window, @@ -1025,4 +1030,5 @@ void PluginObject::FullscreenIdle() { } } +} // namespace glue } // namespace o3d diff --git a/o3d/plugin/plugin.gyp b/o3d/plugin/plugin.gyp index e0065ae..b9e22ab 100644 --- a/o3d/plugin/plugin.gyp +++ b/o3d/plugin/plugin.gyp @@ -75,6 +75,9 @@ ], ['OS == "mac"', { + 'dependencies': [ + '../../breakpad/breakpad.gyp:breakpad', + ], 'sources': [ 'mac/config_mac.mm', 'mac/main_mac.mm', @@ -82,13 +85,24 @@ 'mac/plugin_logging-mac.mm', 'mac/plugin_mac.h', 'mac/plugin_mac.mm', + 'mac/graphics_utils_mac.mm', + ], + 'mac_framework_dirs': [ + '../../breakpad/src/client/mac/build/Release', ], 'defines': [ 'XP_MACOSX=1', ], 'link_settings': { 'libraries': [ + '$(SDKROOT)/System/Library/Frameworks/AGL.framework', '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', + '$(SDKROOT)/System/Library/Frameworks/IOKit.framework', + '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework', + '$(SDKROOT)/System/Library/Frameworks/QuickTime.framework', + '../../breakpad/src/client/mac/build/Release/Breakpad.framework', + '../../third_party/cg/files/mac/Cg.framework', + '../../third_party/glew/files/lib/libGLEW.a', ], }, }, |