diff options
author | Greg Hartman <ghartman@google.com> | 2018-08-17 12:43:34 -0700 |
---|---|---|
committer | Greg Hartman <ghartman@google.com> | 2018-08-23 17:24:52 -0700 |
commit | 8cf8f6b088cc014921e1a9b3d4ebc93c3b5de8b8 (patch) | |
tree | d4968732d8516f2940cfcb340bacdf7693e0ceb3 /eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/launch/NdkGdbLaunchShortcut.java | |
parent | 182e4691d1c5e724fc60ed94b6de8a3356018cb6 (diff) | |
download | device_generic_opengl-transport-8cf8f6b088cc014921e1a9b3d4ebc93c3b5de8b8.tar.gz device_generic_opengl-transport-8cf8f6b088cc014921e1a9b3d4ebc93c3b5de8b8.tar.bz2 device_generic_opengl-transport-8cf8f6b088cc014921e1a9b3d4ebc93c3b5de8b8.zip |
distrib/android-emugl: Move Android GPU emulation sources here.
This patch is used to add the unmodified sources of the GPU
emulation libraries that are normally under sdk/emulator/opengl/.
These sources were originally built with the platform build system,
but this is no longer the case. Since they are only built through
the emulator's own build system (i.e. android-rebuild.sh), it's
easier to put them under external/qemu/ to ensure that they are
always in sync with the rest of the emulator.
Note that the encoder sources are still in the platform under
device/generic/goldfish/opengl/.
A future patch will update the emulator build system to pick
the sources from here, and another one will remove the sources
from sdk/ after that.
Note: these are the unmodified sources from the following
commit in https://android.googlesource.com/platform/sdk.git :
182e469 emulator/opengl: Fix Windows cross-build.
Change-Id: If2010577ef4af4c6755ab345f424af0b546f9282
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/launch/NdkGdbLaunchShortcut.java')
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/launch/NdkGdbLaunchShortcut.java | 127 |
1 files changed, 0 insertions, 127 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/launch/NdkGdbLaunchShortcut.java b/eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/launch/NdkGdbLaunchShortcut.java deleted file mode 100644 index 22eb118a2..000000000 --- a/eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/launch/NdkGdbLaunchShortcut.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php - * - * 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. - */ - -package com.android.ide.eclipse.ndk.internal.launch; - -import com.android.ide.eclipse.adt.AdtPlugin; -import com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController; -import com.android.ide.eclipse.adt.internal.sdk.ProjectState; -import com.android.ide.eclipse.adt.internal.sdk.Sdk; -import com.android.ide.eclipse.ndk.internal.NdkHelper; - -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.ILaunchShortcut; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IEditorPart; - -@SuppressWarnings("restriction") // for adt.internal classes -public class NdkGdbLaunchShortcut implements ILaunchShortcut { - @Override - public void launch(ISelection selection, String mode) { - if (!(selection instanceof IStructuredSelection)) { - return; - } - - Object s = ((IStructuredSelection) selection).getFirstElement(); - if (!(s instanceof IAdaptable)) { - return; - } - - IResource r = (IResource) ((IAdaptable) s).getAdapter(IResource.class); - if (r == null) { - return; - } - - IProject project = r.getProject(); - if (project == null) { - return; - } - - // verify that this is a non library Android project - ProjectState state = Sdk.getProjectState(project); - if (state == null || state.isLibrary()) { - return; - } - - // verify that this project has C/C++ nature - if (!CoreModel.hasCCNature(project) && !CoreModel.hasCNature(project)) { - AdtPlugin.printErrorToConsole(project, - String.format("Selected project (%s) does not have C/C++ nature. " - + "To add native support, right click on the project, " - + "Android Tools -> Add Native Support", - project.getName())); - return; - } - - debugProject(project, mode); - } - - @Override - public void launch(IEditorPart editor, String mode) { - } - - private void debugProject(IProject project, String mode) { - // obtain existing native debug config for project - ILaunchConfiguration config = AndroidLaunchController.getLaunchConfig(project, - NdkGdbLaunchDelegate.LAUNCH_TYPE_ID); - if (config == null) { - return; - } - - // Set the ndk gdb specific launch attributes in the config (if necessary) - if (!hasNdkAttributes(config)) { - try { - config = setNdkDefaults(config, project); - } catch (CoreException e) { - AdtPlugin.printErrorToConsole(project, - "Unable to create launch configuration for project."); - return; - } - } - - // launch - DebugUITools.launch(config, mode); - } - - private boolean hasNdkAttributes(ILaunchConfiguration config) { - try { - // All NDK launch configurations have ATTR_REMOTE_TCP set to true - boolean isRemote = config.getAttribute(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, - false); - return isRemote; - } catch (CoreException e) { - return false; - } - } - - private ILaunchConfiguration setNdkDefaults(ILaunchConfiguration config, IProject project) - throws CoreException { - ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy(); - NdkHelper.setLaunchConfigDefaults(wc); - wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName()); - return wc.doSave(); - } -} |