diff options
author | Siva Velusamy <vsiva@google.com> | 2011-12-06 13:43:51 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-12-06 13:43:51 -0800 |
commit | fa11aa3cc8da59afc652f884f8d9e8ca84552704 (patch) | |
tree | cf8b224ebb9a6bfc5fccfb1766fcad4cf9f03962 /eclipse/plugins | |
parent | 869883b8cbe5aef205a9eeeb82a243a4ea0ed3f7 (diff) | |
parent | 235fcab659a1f633d3b97a18a115e24fa8dd6308 (diff) | |
download | sdk-fa11aa3cc8da59afc652f884f8d9e8ca84552704.zip sdk-fa11aa3cc8da59afc652f884f8d9e8ca84552704.tar.gz sdk-fa11aa3cc8da59afc652f884f8d9e8ca84552704.tar.bz2 |
Merge "gltrace: do not store images in memory"
Diffstat (limited to 'eclipse/plugins')
16 files changed, 3231 insertions, 1927 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLCallFormatter.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLCallFormatter.java index ea438df..4e67eaa 100644 --- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLCallFormatter.java +++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLCallFormatter.java @@ -17,9 +17,9 @@ package com.android.ide.eclipse.gltrace; import com.android.ide.eclipse.gldebugger.GLEnum; -import com.android.ide.eclipse.gltrace.Glcall.GLCall; -import com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType; -import com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.Type; +import com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType; +import com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.Type; +import com.android.ide.eclipse.gltrace.model.GLCall; import java.io.BufferedReader; import java.io.IOException; @@ -32,8 +32,8 @@ import java.util.List; import java.util.Map; /** - * GLCallFormatter is used to format and create a string representation for a protobuf encoded - * {@link GLCall}. It reads in the GL API definitions from a file to know about all the GL calls, + * GLCallFormatter is used to format and create a string representation for a {@link GLCall}. + * It reads in the GL API definitions from a file to know about all the GL calls, * their return types and their arguments. Using this information, each GLCall is * parsed and formatted appropriately for display. */ @@ -135,7 +135,7 @@ public class GLCallFormatter { } else { sb.append(argSpec.getArgName()); sb.append(" = "); - sb.append(formatArgValue(glCall.getArgs(i), typeSpec)); + sb.append(formatArgValue(glCall.getArg(i), typeSpec)); } if (i < argSpecs.size() - 1) { @@ -154,7 +154,7 @@ public class GLCallFormatter { switch (typeSpec) { case VOID: return ""; - case BOOLEAN: + case BOOL: return Boolean.toString(arg.getBoolValue(0)); case FLOAT: return String.format("%f", arg.getFloatValue(0)); @@ -170,7 +170,7 @@ public class GLCallFormatter { private String formatPointer(DataType args) { // Display as array if possible switch (args.getType()) { - case BOOLEAN: + case BOOL: return args.getBoolValueList().toString(); case FLOAT: return args.getFloatValueList().toString(); @@ -229,7 +229,7 @@ public class GLCallFormatter { // the type name along with qualifiers. e.g. "void", "GLvoid" and "void*" should // all be assigned the same type. if (type.contains("boolean")) { - return Type.BOOLEAN; + return Type.BOOL; } else if (type.contains("enum")) { return Type.ENUM; } else if (type.contains("float") || type.contains("clampf")) { diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLProtoBuf.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLProtoBuf.java new file mode 100644 index 0000000..ceb32fc --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLProtoBuf.java @@ -0,0 +1,2609 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: gltrace.proto + +package com.android.ide.eclipse.gltrace; + +public final class GLProtoBuf { + private GLProtoBuf() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + public static final class GLMessage extends + com.google.protobuf.GeneratedMessageLite { + // Use GLMessage.newBuilder() to construct. + private GLMessage() { + initFields(); + } + private GLMessage(boolean noInit) {} + + private static final GLMessage defaultInstance; + public static GLMessage getDefaultInstance() { + return defaultInstance; + } + + public GLMessage getDefaultInstanceForType() { + return defaultInstance; + } + + public enum Function + implements com.google.protobuf.Internal.EnumLite { + glActiveTexture(0, 0), + glAlphaFunc(1, 1), + glAlphaFuncx(2, 2), + glAlphaFuncxOES(3, 3), + glAttachShader(4, 4), + glBeginPerfMonitorAMD(5, 5), + glBindAttribLocation(6, 6), + glBindBuffer(7, 7), + glBindFramebuffer(8, 8), + glBindFramebufferOES(9, 9), + glBindRenderbuffer(10, 10), + glBindRenderbufferOES(11, 11), + glBindTexture(12, 12), + glBindVertexArrayOES(13, 13), + glBlendColor(14, 14), + glBlendEquation(15, 15), + glBlendEquationOES(16, 16), + glBlendEquationSeparate(17, 17), + glBlendEquationSeparateOES(18, 18), + glBlendFunc(19, 19), + glBlendFuncSeparate(20, 20), + glBlendFuncSeparateOES(21, 21), + glBufferData(22, 22), + glBufferSubData(23, 23), + glCheckFramebufferStatus(24, 24), + glCheckFramebufferStatusOES(25, 25), + glClearColor(26, 26), + glClearColorx(27, 27), + glClearColorxOES(28, 28), + glClearDepthf(29, 29), + glClearDepthfOES(30, 30), + glClearDepthx(31, 31), + glClearDepthxOES(32, 32), + glClear(33, 33), + glClearStencil(34, 34), + glClientActiveTexture(35, 35), + glClipPlanef(36, 36), + glClipPlanefIMG(37, 37), + glClipPlanefOES(38, 38), + glClipPlanex(39, 39), + glClipPlanexIMG(40, 40), + glClipPlanexOES(41, 41), + glColor4f(42, 42), + glColor4ub(43, 43), + glColor4x(44, 44), + glColor4xOES(45, 45), + glColorMask(46, 46), + glColorPointer(47, 47), + glCompileShader(48, 48), + glCompressedTexImage2D(49, 49), + glCompressedTexImage3DOES(50, 50), + glCompressedTexSubImage2D(51, 51), + glCompressedTexSubImage3DOES(52, 52), + glCopyTexImage2D(53, 53), + glCopyTexSubImage2D(54, 54), + glCopyTexSubImage3DOES(55, 55), + glCoverageMaskNV(56, 56), + glCoverageOperationNV(57, 57), + glCreateProgram(58, 58), + glCreateShader(59, 59), + glCullFace(60, 60), + glCurrentPaletteMatrixOES(61, 61), + glDeleteBuffers(62, 62), + glDeleteFencesNV(63, 63), + glDeleteFramebuffers(64, 64), + glDeleteFramebuffersOES(65, 65), + glDeletePerfMonitorsAMD(66, 66), + glDeleteProgram(67, 67), + glDeleteRenderbuffers(68, 68), + glDeleteRenderbuffersOES(69, 69), + glDeleteShader(70, 70), + glDeleteTextures(71, 71), + glDeleteVertexArraysOES(72, 72), + glDepthFunc(73, 73), + glDepthMask(74, 74), + glDepthRangef(75, 75), + glDepthRangefOES(76, 76), + glDepthRangex(77, 77), + glDepthRangexOES(78, 78), + glDetachShader(79, 79), + glDisableClientState(80, 80), + glDisableDriverControlQCOM(81, 81), + glDisable(82, 82), + glDisableVertexAttribArray(83, 83), + glDiscardFramebufferEXT(84, 84), + glDrawArrays(85, 85), + glDrawElements(86, 86), + glDrawTexfOES(87, 87), + glDrawTexfvOES(88, 88), + glDrawTexiOES(89, 89), + glDrawTexivOES(90, 90), + glDrawTexsOES(91, 91), + glDrawTexsvOES(92, 92), + glDrawTexxOES(93, 93), + glDrawTexxvOES(94, 94), + glEGLImageTargetRenderbufferStorageOES(95, 95), + glEGLImageTargetTexture2DOES(96, 96), + glEnableClientState(97, 97), + glEnableDriverControlQCOM(98, 98), + glEnable(99, 99), + glEnableVertexAttribArray(100, 100), + glEndPerfMonitorAMD(101, 101), + glEndTilingQCOM(102, 102), + glExtGetBufferPointervQCOM(103, 103), + glExtGetBuffersQCOM(104, 104), + glExtGetFramebuffersQCOM(105, 105), + glExtGetProgramBinarySourceQCOM(106, 106), + glExtGetProgramsQCOM(107, 107), + glExtGetRenderbuffersQCOM(108, 108), + glExtGetShadersQCOM(109, 109), + glExtGetTexLevelParameterivQCOM(110, 110), + glExtGetTexSubImageQCOM(111, 111), + glExtGetTexturesQCOM(112, 112), + glExtIsProgramBinaryQCOM(113, 113), + glExtTexObjectStateOverrideiQCOM(114, 114), + glFinishFenceNV(115, 115), + glFinish(116, 116), + glFlush(117, 117), + glFogf(118, 118), + glFogfv(119, 119), + glFogx(120, 120), + glFogxOES(121, 121), + glFogxv(122, 122), + glFogxvOES(123, 123), + glFramebufferRenderbuffer(124, 124), + glFramebufferRenderbufferOES(125, 125), + glFramebufferTexture2D(126, 126), + glFramebufferTexture2DMultisampleIMG(127, 127), + glFramebufferTexture2DOES(128, 128), + glFramebufferTexture3DOES(129, 129), + glFrontFace(130, 130), + glFrustumf(131, 131), + glFrustumfOES(132, 132), + glFrustumx(133, 133), + glFrustumxOES(134, 134), + glGenBuffers(135, 135), + glGenerateMipmap(136, 136), + glGenerateMipmapOES(137, 137), + glGenFencesNV(138, 138), + glGenFramebuffers(139, 139), + glGenFramebuffersOES(140, 140), + glGenPerfMonitorsAMD(141, 141), + glGenRenderbuffers(142, 142), + glGenRenderbuffersOES(143, 143), + glGenTextures(144, 144), + glGenVertexArraysOES(145, 145), + glGetActiveAttrib(146, 146), + glGetActiveUniform(147, 147), + glGetAttachedShaders(148, 148), + glGetAttribLocation(149, 149), + glGetBooleanv(150, 150), + glGetBufferParameteriv(151, 151), + glGetBufferPointervOES(152, 152), + glGetClipPlanef(153, 153), + glGetClipPlanefOES(154, 154), + glGetClipPlanex(155, 155), + glGetClipPlanexOES(156, 156), + glGetDriverControlsQCOM(157, 157), + glGetDriverControlStringQCOM(158, 158), + glGetError(159, 159), + glGetFenceivNV(160, 160), + glGetFixedv(161, 161), + glGetFixedvOES(162, 162), + glGetFloatv(163, 163), + glGetFramebufferAttachmentParameteriv(164, 164), + glGetFramebufferAttachmentParameterivOES(165, 165), + glGetIntegerv(166, 166), + glGetLightfv(167, 167), + glGetLightxv(168, 168), + glGetLightxvOES(169, 169), + glGetMaterialfv(170, 170), + glGetMaterialxv(171, 171), + glGetMaterialxvOES(172, 172), + glGetPerfMonitorCounterDataAMD(173, 173), + glGetPerfMonitorCounterInfoAMD(174, 174), + glGetPerfMonitorCountersAMD(175, 175), + glGetPerfMonitorCounterStringAMD(176, 176), + glGetPerfMonitorGroupsAMD(177, 177), + glGetPerfMonitorGroupStringAMD(178, 178), + glGetPointerv(179, 179), + glGetProgramBinaryOES(180, 180), + glGetProgramInfoLog(181, 181), + glGetProgramiv(182, 182), + glGetRenderbufferParameteriv(183, 183), + glGetRenderbufferParameterivOES(184, 184), + glGetShaderInfoLog(185, 185), + glGetShaderiv(186, 186), + glGetShaderPrecisionFormat(187, 187), + glGetShaderSource(188, 188), + glGetString(189, 189), + glGetTexEnvfv(190, 190), + glGetTexEnviv(191, 191), + glGetTexEnvxv(192, 192), + glGetTexEnvxvOES(193, 193), + glGetTexGenfvOES(194, 194), + glGetTexGenivOES(195, 195), + glGetTexGenxvOES(196, 196), + glGetTexParameterfv(197, 197), + glGetTexParameteriv(198, 198), + glGetTexParameterxv(199, 199), + glGetTexParameterxvOES(200, 200), + glGetUniformfv(201, 201), + glGetUniformiv(202, 202), + glGetUniformLocation(203, 203), + glGetVertexAttribfv(204, 204), + glGetVertexAttribiv(205, 205), + glGetVertexAttribPointerv(206, 206), + glHint(207, 207), + glIsBuffer(208, 208), + glIsEnabled(209, 209), + glIsFenceNV(210, 210), + glIsFramebuffer(211, 211), + glIsFramebufferOES(212, 212), + glIsProgram(213, 213), + glIsRenderbuffer(214, 214), + glIsRenderbufferOES(215, 215), + glIsShader(216, 216), + glIsTexture(217, 217), + glIsVertexArrayOES(218, 218), + glLightf(219, 219), + glLightfv(220, 220), + glLightModelf(221, 221), + glLightModelfv(222, 222), + glLightModelx(223, 223), + glLightModelxOES(224, 224), + glLightModelxv(225, 225), + glLightModelxvOES(226, 226), + glLightx(227, 227), + glLightxOES(228, 228), + glLightxv(229, 229), + glLightxvOES(230, 230), + glLineWidth(231, 231), + glLineWidthx(232, 232), + glLineWidthxOES(233, 233), + glLinkProgram(234, 234), + glLoadIdentity(235, 235), + glLoadMatrixf(236, 236), + glLoadMatrixx(237, 237), + glLoadMatrixxOES(238, 238), + glLoadPaletteFromModelViewMatrixOES(239, 239), + glLogicOp(240, 240), + glMapBufferOES(241, 241), + glMaterialf(242, 242), + glMaterialfv(243, 243), + glMaterialx(244, 244), + glMaterialxOES(245, 245), + glMaterialxv(246, 246), + glMaterialxvOES(247, 247), + glMatrixIndexPointerOES(248, 248), + glMatrixMode(249, 249), + glMultiDrawArraysEXT(250, 250), + glMultiDrawElementsEXT(251, 251), + glMultiTexCoord4f(252, 252), + glMultiTexCoord4x(253, 253), + glMultiTexCoord4xOES(254, 254), + glMultMatrixf(255, 255), + glMultMatrixx(256, 256), + glMultMatrixxOES(257, 257), + glNormal3f(258, 258), + glNormal3x(259, 259), + glNormal3xOES(260, 260), + glNormalPointer(261, 261), + glOrthof(262, 262), + glOrthofOES(263, 263), + glOrthox(264, 264), + glOrthoxOES(265, 265), + glPixelStorei(266, 266), + glPointParameterf(267, 267), + glPointParameterfv(268, 268), + glPointParameterx(269, 269), + glPointParameterxOES(270, 270), + glPointParameterxv(271, 271), + glPointParameterxvOES(272, 272), + glPointSize(273, 273), + glPointSizePointerOES(274, 274), + glPointSizex(275, 275), + glPointSizexOES(276, 276), + glPolygonOffset(277, 277), + glPolygonOffsetx(278, 278), + glPolygonOffsetxOES(279, 279), + glPopMatrix(280, 280), + glProgramBinaryOES(281, 281), + glPushMatrix(282, 282), + glQueryMatrixxOES(283, 283), + glReadPixels(284, 284), + glReleaseShaderCompiler(285, 285), + glRenderbufferStorage(286, 286), + glRenderbufferStorageMultisampleIMG(287, 287), + glRenderbufferStorageOES(288, 288), + glRotatef(289, 289), + glRotatex(290, 290), + glRotatexOES(291, 291), + glSampleCoverage(292, 292), + glSampleCoveragex(293, 293), + glSampleCoveragexOES(294, 294), + glScalef(295, 295), + glScalex(296, 296), + glScalexOES(297, 297), + glScissor(298, 298), + glSelectPerfMonitorCountersAMD(299, 299), + glSetFenceNV(300, 300), + glShadeModel(301, 301), + glShaderBinary(302, 302), + glShaderSource(303, 303), + glStartTilingQCOM(304, 304), + glStencilFunc(305, 305), + glStencilFuncSeparate(306, 306), + glStencilMask(307, 307), + glStencilMaskSeparate(308, 308), + glStencilOp(309, 309), + glStencilOpSeparate(310, 310), + glTestFenceNV(311, 311), + glTexCoordPointer(312, 312), + glTexEnvf(313, 313), + glTexEnvfv(314, 314), + glTexEnvi(315, 315), + glTexEnviv(316, 316), + glTexEnvx(317, 317), + glTexEnvxOES(318, 318), + glTexEnvxv(319, 319), + glTexEnvxvOES(320, 320), + glTexGenfOES(321, 321), + glTexGenfvOES(322, 322), + glTexGeniOES(323, 323), + glTexGenivOES(324, 324), + glTexGenxOES(325, 325), + glTexGenxvOES(326, 326), + glTexImage2D(327, 327), + glTexImage3DOES(328, 328), + glTexParameterf(329, 329), + glTexParameterfv(330, 330), + glTexParameteri(331, 331), + glTexParameteriv(332, 332), + glTexParameterx(333, 333), + glTexParameterxOES(334, 334), + glTexParameterxv(335, 335), + glTexParameterxvOES(336, 336), + glTexSubImage2D(337, 337), + glTexSubImage3DOES(338, 338), + glTranslatef(339, 339), + glTranslatex(340, 340), + glTranslatexOES(341, 341), + glUniform1f(342, 342), + glUniform1fv(343, 343), + glUniform1i(344, 344), + glUniform1iv(345, 345), + glUniform2f(346, 346), + glUniform2fv(347, 347), + glUniform2i(348, 348), + glUniform2iv(349, 349), + glUniform3f(350, 350), + glUniform3fv(351, 351), + glUniform3i(352, 352), + glUniform3iv(353, 353), + glUniform4f(354, 354), + glUniform4fv(355, 355), + glUniform4i(356, 356), + glUniform4iv(357, 357), + glUniformMatrix2fv(358, 358), + glUniformMatrix3fv(359, 359), + glUniformMatrix4fv(360, 360), + glUnmapBufferOES(361, 361), + glUseProgram(362, 362), + glValidateProgram(363, 363), + glVertexAttrib1f(364, 364), + glVertexAttrib1fv(365, 365), + glVertexAttrib2f(366, 366), + glVertexAttrib2fv(367, 367), + glVertexAttrib3f(368, 368), + glVertexAttrib3fv(369, 369), + glVertexAttrib4f(370, 370), + glVertexAttrib4fv(371, 371), + glVertexAttribPointer(372, 372), + glVertexPointer(373, 373), + glViewport(374, 374), + glWeightPointerOES(375, 375), + eglGetDisplay(376, 2000), + eglInitialize(377, 2001), + eglTerminate(378, 2002), + eglGetConfigs(379, 2003), + eglChooseConfig(380, 2004), + eglGetConfigAttrib(381, 2005), + eglCreateWindowSurface(382, 2006), + eglCreatePixmapSurface(383, 2007), + eglCreatePbufferSurface(384, 2008), + eglDestroySurface(385, 2009), + eglQuerySurface(386, 2010), + eglCreateContext(387, 2011), + eglDestroyContext(388, 2012), + eglMakeCurrent(389, 2013), + eglGetCurrentContext(390, 2014), + eglGetCurrentSurface(391, 2015), + eglGetCurrentDisplay(392, 2016), + eglQueryContext(393, 2017), + eglWaitGL(394, 2018), + eglWaitNative(395, 2019), + eglSwapBuffers(396, 2020), + eglCopyBuffers(397, 2021), + eglGetError(398, 2022), + eglQueryString(399, 2023), + eglGetProcAddress(400, 2024), + eglSurfaceAttrib(401, 2025), + eglBindTexImage(402, 2026), + eglReleaseTexImage(403, 2027), + eglSwapInterval(404, 2028), + eglBindAPI(405, 2029), + eglQueryAPI(406, 2030), + eglWaitClient(407, 2031), + eglReleaseThread(408, 2032), + eglCreatePbufferFromClientBuffer(409, 2033), + eglLockSurfaceKHR(410, 2034), + eglUnlockSurfaceKHR(411, 2035), + eglCreateImageKHR(412, 2036), + eglDestroyImageKHR(413, 2037), + eglCreateSyncKHR(414, 2038), + eglDestroySyncKHR(415, 2039), + eglClientWaitSyncKHR(416, 2040), + eglGetSyncAttribKHR(417, 2041), + eglSetSwapRectangleANDROID(418, 2042), + eglGetRenderBufferANDROID(419, 2043), + eglGetSystemTimeFrequencyNV(420, 2044), + eglGetSystemTimeNV(421, 2045), + invalid(422, 3000), + frameBufferContents(423, 3001), + ; + + + public final int getNumber() { return value; } + + public static Function valueOf(int value) { + switch (value) { + case 0: return glActiveTexture; + case 1: return glAlphaFunc; + case 2: return glAlphaFuncx; + case 3: return glAlphaFuncxOES; + case 4: return glAttachShader; + case 5: return glBeginPerfMonitorAMD; + case 6: return glBindAttribLocation; + case 7: return glBindBuffer; + case 8: return glBindFramebuffer; + case 9: return glBindFramebufferOES; + case 10: return glBindRenderbuffer; + case 11: return glBindRenderbufferOES; + case 12: return glBindTexture; + case 13: return glBindVertexArrayOES; + case 14: return glBlendColor; + case 15: return glBlendEquation; + case 16: return glBlendEquationOES; + case 17: return glBlendEquationSeparate; + case 18: return glBlendEquationSeparateOES; + case 19: return glBlendFunc; + case 20: return glBlendFuncSeparate; + case 21: return glBlendFuncSeparateOES; + case 22: return glBufferData; + case 23: return glBufferSubData; + case 24: return glCheckFramebufferStatus; + case 25: return glCheckFramebufferStatusOES; + case 26: return glClearColor; + case 27: return glClearColorx; + case 28: return glClearColorxOES; + case 29: return glClearDepthf; + case 30: return glClearDepthfOES; + case 31: return glClearDepthx; + case 32: return glClearDepthxOES; + case 33: return glClear; + case 34: return glClearStencil; + case 35: return glClientActiveTexture; + case 36: return glClipPlanef; + case 37: return glClipPlanefIMG; + case 38: return glClipPlanefOES; + case 39: return glClipPlanex; + case 40: return glClipPlanexIMG; + case 41: return glClipPlanexOES; + case 42: return glColor4f; + case 43: return glColor4ub; + case 44: return glColor4x; + case 45: return glColor4xOES; + case 46: return glColorMask; + case 47: return glColorPointer; + case 48: return glCompileShader; + case 49: return glCompressedTexImage2D; + case 50: return glCompressedTexImage3DOES; + case 51: return glCompressedTexSubImage2D; + case 52: return glCompressedTexSubImage3DOES; + case 53: return glCopyTexImage2D; + case 54: return glCopyTexSubImage2D; + case 55: return glCopyTexSubImage3DOES; + case 56: return glCoverageMaskNV; + case 57: return glCoverageOperationNV; + case 58: return glCreateProgram; + case 59: return glCreateShader; + case 60: return glCullFace; + case 61: return glCurrentPaletteMatrixOES; + case 62: return glDeleteBuffers; + case 63: return glDeleteFencesNV; + case 64: return glDeleteFramebuffers; + case 65: return glDeleteFramebuffersOES; + case 66: return glDeletePerfMonitorsAMD; + case 67: return glDeleteProgram; + case 68: return glDeleteRenderbuffers; + case 69: return glDeleteRenderbuffersOES; + case 70: return glDeleteShader; + case 71: return glDeleteTextures; + case 72: return glDeleteVertexArraysOES; + case 73: return glDepthFunc; + case 74: return glDepthMask; + case 75: return glDepthRangef; + case 76: return glDepthRangefOES; + case 77: return glDepthRangex; + case 78: return glDepthRangexOES; + case 79: return glDetachShader; + case 80: return glDisableClientState; + case 81: return glDisableDriverControlQCOM; + case 82: return glDisable; + case 83: return glDisableVertexAttribArray; + case 84: return glDiscardFramebufferEXT; + case 85: return glDrawArrays; + case 86: return glDrawElements; + case 87: return glDrawTexfOES; + case 88: return glDrawTexfvOES; + case 89: return glDrawTexiOES; + case 90: return glDrawTexivOES; + case 91: return glDrawTexsOES; + case 92: return glDrawTexsvOES; + case 93: return glDrawTexxOES; + case 94: return glDrawTexxvOES; + case 95: return glEGLImageTargetRenderbufferStorageOES; + case 96: return glEGLImageTargetTexture2DOES; + case 97: return glEnableClientState; + case 98: return glEnableDriverControlQCOM; + case 99: return glEnable; + case 100: return glEnableVertexAttribArray; + case 101: return glEndPerfMonitorAMD; + case 102: return glEndTilingQCOM; + case 103: return glExtGetBufferPointervQCOM; + case 104: return glExtGetBuffersQCOM; + case 105: return glExtGetFramebuffersQCOM; + case 106: return glExtGetProgramBinarySourceQCOM; + case 107: return glExtGetProgramsQCOM; + case 108: return glExtGetRenderbuffersQCOM; + case 109: return glExtGetShadersQCOM; + case 110: return glExtGetTexLevelParameterivQCOM; + case 111: return glExtGetTexSubImageQCOM; + case 112: return glExtGetTexturesQCOM; + case 113: return glExtIsProgramBinaryQCOM; + case 114: return glExtTexObjectStateOverrideiQCOM; + case 115: return glFinishFenceNV; + case 116: return glFinish; + case 117: return glFlush; + case 118: return glFogf; + case 119: return glFogfv; + case 120: return glFogx; + case 121: return glFogxOES; + case 122: return glFogxv; + case 123: return glFogxvOES; + case 124: return glFramebufferRenderbuffer; + case 125: return glFramebufferRenderbufferOES; + case 126: return glFramebufferTexture2D; + case 127: return glFramebufferTexture2DMultisampleIMG; + case 128: return glFramebufferTexture2DOES; + case 129: return glFramebufferTexture3DOES; + case 130: return glFrontFace; + case 131: return glFrustumf; + case 132: return glFrustumfOES; + case 133: return glFrustumx; + case 134: return glFrustumxOES; + case 135: return glGenBuffers; + case 136: return glGenerateMipmap; + case 137: return glGenerateMipmapOES; + case 138: return glGenFencesNV; + case 139: return glGenFramebuffers; + case 140: return glGenFramebuffersOES; + case 141: return glGenPerfMonitorsAMD; + case 142: return glGenRenderbuffers; + case 143: return glGenRenderbuffersOES; + case 144: return glGenTextures; + case 145: return glGenVertexArraysOES; + case 146: return glGetActiveAttrib; + case 147: return glGetActiveUniform; + case 148: return glGetAttachedShaders; + case 149: return glGetAttribLocation; + case 150: return glGetBooleanv; + case 151: return glGetBufferParameteriv; + case 152: return glGetBufferPointervOES; + case 153: return glGetClipPlanef; + case 154: return glGetClipPlanefOES; + case 155: return glGetClipPlanex; + case 156: return glGetClipPlanexOES; + case 157: return glGetDriverControlsQCOM; + case 158: return glGetDriverControlStringQCOM; + case 159: return glGetError; + case 160: return glGetFenceivNV; + case 161: return glGetFixedv; + case 162: return glGetFixedvOES; + case 163: return glGetFloatv; + case 164: return glGetFramebufferAttachmentParameteriv; + case 165: return glGetFramebufferAttachmentParameterivOES; + case 166: return glGetIntegerv; + case 167: return glGetLightfv; + case 168: return glGetLightxv; + case 169: return glGetLightxvOES; + case 170: return glGetMaterialfv; + case 171: return glGetMaterialxv; + case 172: return glGetMaterialxvOES; + case 173: return glGetPerfMonitorCounterDataAMD; + case 174: return glGetPerfMonitorCounterInfoAMD; + case 175: return glGetPerfMonitorCountersAMD; + case 176: return glGetPerfMonitorCounterStringAMD; + case 177: return glGetPerfMonitorGroupsAMD; + case 178: return glGetPerfMonitorGroupStringAMD; + case 179: return glGetPointerv; + case 180: return glGetProgramBinaryOES; + case 181: return glGetProgramInfoLog; + case 182: return glGetProgramiv; + case 183: return glGetRenderbufferParameteriv; + case 184: return glGetRenderbufferParameterivOES; + case 185: return glGetShaderInfoLog; + case 186: return glGetShaderiv; + case 187: return glGetShaderPrecisionFormat; + case 188: return glGetShaderSource; + case 189: return glGetString; + case 190: return glGetTexEnvfv; + case 191: return glGetTexEnviv; + case 192: return glGetTexEnvxv; + case 193: return glGetTexEnvxvOES; + case 194: return glGetTexGenfvOES; + case 195: return glGetTexGenivOES; + case 196: return glGetTexGenxvOES; + case 197: return glGetTexParameterfv; + case 198: return glGetTexParameteriv; + case 199: return glGetTexParameterxv; + case 200: return glGetTexParameterxvOES; + case 201: return glGetUniformfv; + case 202: return glGetUniformiv; + case 203: return glGetUniformLocation; + case 204: return glGetVertexAttribfv; + case 205: return glGetVertexAttribiv; + case 206: return glGetVertexAttribPointerv; + case 207: return glHint; + case 208: return glIsBuffer; + case 209: return glIsEnabled; + case 210: return glIsFenceNV; + case 211: return glIsFramebuffer; + case 212: return glIsFramebufferOES; + case 213: return glIsProgram; + case 214: return glIsRenderbuffer; + case 215: return glIsRenderbufferOES; + case 216: return glIsShader; + case 217: return glIsTexture; + case 218: return glIsVertexArrayOES; + case 219: return glLightf; + case 220: return glLightfv; + case 221: return glLightModelf; + case 222: return glLightModelfv; + case 223: return glLightModelx; + case 224: return glLightModelxOES; + case 225: return glLightModelxv; + case 226: return glLightModelxvOES; + case 227: return glLightx; + case 228: return glLightxOES; + case 229: return glLightxv; + case 230: return glLightxvOES; + case 231: return glLineWidth; + case 232: return glLineWidthx; + case 233: return glLineWidthxOES; + case 234: return glLinkProgram; + case 235: return glLoadIdentity; + case 236: return glLoadMatrixf; + case 237: return glLoadMatrixx; + case 238: return glLoadMatrixxOES; + case 239: return glLoadPaletteFromModelViewMatrixOES; + case 240: return glLogicOp; + case 241: return glMapBufferOES; + case 242: return glMaterialf; + case 243: return glMaterialfv; + case 244: return glMaterialx; + case 245: return glMaterialxOES; + case 246: return glMaterialxv; + case 247: return glMaterialxvOES; + case 248: return glMatrixIndexPointerOES; + case 249: return glMatrixMode; + case 250: return glMultiDrawArraysEXT; + case 251: return glMultiDrawElementsEXT; + case 252: return glMultiTexCoord4f; + case 253: return glMultiTexCoord4x; + case 254: return glMultiTexCoord4xOES; + case 255: return glMultMatrixf; + case 256: return glMultMatrixx; + case 257: return glMultMatrixxOES; + case 258: return glNormal3f; + case 259: return glNormal3x; + case 260: return glNormal3xOES; + case 261: return glNormalPointer; + case 262: return glOrthof; + case 263: return glOrthofOES; + case 264: return glOrthox; + case 265: return glOrthoxOES; + case 266: return glPixelStorei; + case 267: return glPointParameterf; + case 268: return glPointParameterfv; + case 269: return glPointParameterx; + case 270: return glPointParameterxOES; + case 271: return glPointParameterxv; + case 272: return glPointParameterxvOES; + case 273: return glPointSize; + case 274: return glPointSizePointerOES; + case 275: return glPointSizex; + case 276: return glPointSizexOES; + case 277: return glPolygonOffset; + case 278: return glPolygonOffsetx; + case 279: return glPolygonOffsetxOES; + case 280: return glPopMatrix; + case 281: return glProgramBinaryOES; + case 282: return glPushMatrix; + case 283: return glQueryMatrixxOES; + case 284: return glReadPixels; + case 285: return glReleaseShaderCompiler; + case 286: return glRenderbufferStorage; + case 287: return glRenderbufferStorageMultisampleIMG; + case 288: return glRenderbufferStorageOES; + case 289: return glRotatef; + case 290: return glRotatex; + case 291: return glRotatexOES; + case 292: return glSampleCoverage; + case 293: return glSampleCoveragex; + case 294: return glSampleCoveragexOES; + case 295: return glScalef; + case 296: return glScalex; + case 297: return glScalexOES; + case 298: return glScissor; + case 299: return glSelectPerfMonitorCountersAMD; + case 300: return glSetFenceNV; + case 301: return glShadeModel; + case 302: return glShaderBinary; + case 303: return glShaderSource; + case 304: return glStartTilingQCOM; + case 305: return glStencilFunc; + case 306: return glStencilFuncSeparate; + case 307: return glStencilMask; + case 308: return glStencilMaskSeparate; + case 309: return glStencilOp; + case 310: return glStencilOpSeparate; + case 311: return glTestFenceNV; + case 312: return glTexCoordPointer; + case 313: return glTexEnvf; + case 314: return glTexEnvfv; + case 315: return glTexEnvi; + case 316: return glTexEnviv; + case 317: return glTexEnvx; + case 318: return glTexEnvxOES; + case 319: return glTexEnvxv; + case 320: return glTexEnvxvOES; + case 321: return glTexGenfOES; + case 322: return glTexGenfvOES; + case 323: return glTexGeniOES; + case 324: return glTexGenivOES; + case 325: return glTexGenxOES; + case 326: return glTexGenxvOES; + case 327: return glTexImage2D; + case 328: return glTexImage3DOES; + case 329: return glTexParameterf; + case 330: return glTexParameterfv; + case 331: return glTexParameteri; + case 332: return glTexParameteriv; + case 333: return glTexParameterx; + case 334: return glTexParameterxOES; + case 335: return glTexParameterxv; + case 336: return glTexParameterxvOES; + case 337: return glTexSubImage2D; + case 338: return glTexSubImage3DOES; + case 339: return glTranslatef; + case 340: return glTranslatex; + case 341: return glTranslatexOES; + case 342: return glUniform1f; + case 343: return glUniform1fv; + case 344: return glUniform1i; + case 345: return glUniform1iv; + case 346: return glUniform2f; + case 347: return glUniform2fv; + case 348: return glUniform2i; + case 349: return glUniform2iv; + case 350: return glUniform3f; + case 351: return glUniform3fv; + case 352: return glUniform3i; + case 353: return glUniform3iv; + case 354: return glUniform4f; + case 355: return glUniform4fv; + case 356: return glUniform4i; + case 357: return glUniform4iv; + case 358: return glUniformMatrix2fv; + case 359: return glUniformMatrix3fv; + case 360: return glUniformMatrix4fv; + case 361: return glUnmapBufferOES; + case 362: return glUseProgram; + case 363: return glValidateProgram; + case 364: return glVertexAttrib1f; + case 365: return glVertexAttrib1fv; + case 366: return glVertexAttrib2f; + case 367: return glVertexAttrib2fv; + case 368: return glVertexAttrib3f; + case 369: return glVertexAttrib3fv; + case 370: return glVertexAttrib4f; + case 371: return glVertexAttrib4fv; + case 372: return glVertexAttribPointer; + case 373: return glVertexPointer; + case 374: return glViewport; + case 375: return glWeightPointerOES; + case 2000: return eglGetDisplay; + case 2001: return eglInitialize; + case 2002: return eglTerminate; + case 2003: return eglGetConfigs; + case 2004: return eglChooseConfig; + case 2005: return eglGetConfigAttrib; + case 2006: return eglCreateWindowSurface; + case 2007: return eglCreatePixmapSurface; + case 2008: return eglCreatePbufferSurface; + case 2009: return eglDestroySurface; + case 2010: return eglQuerySurface; + case 2011: return eglCreateContext; + case 2012: return eglDestroyContext; + case 2013: return eglMakeCurrent; + case 2014: return eglGetCurrentContext; + case 2015: return eglGetCurrentSurface; + case 2016: return eglGetCurrentDisplay; + case 2017: return eglQueryContext; + case 2018: return eglWaitGL; + case 2019: return eglWaitNative; + case 2020: return eglSwapBuffers; + case 2021: return eglCopyBuffers; + case 2022: return eglGetError; + case 2023: return eglQueryString; + case 2024: return eglGetProcAddress; + case 2025: return eglSurfaceAttrib; + case 2026: return eglBindTexImage; + case 2027: return eglReleaseTexImage; + case 2028: return eglSwapInterval; + case 2029: return eglBindAPI; + case 2030: return eglQueryAPI; + case 2031: return eglWaitClient; + case 2032: return eglReleaseThread; + case 2033: return eglCreatePbufferFromClientBuffer; + case 2034: return eglLockSurfaceKHR; + case 2035: return eglUnlockSurfaceKHR; + case 2036: return eglCreateImageKHR; + case 2037: return eglDestroyImageKHR; + case 2038: return eglCreateSyncKHR; + case 2039: return eglDestroySyncKHR; + case 2040: return eglClientWaitSyncKHR; + case 2041: return eglGetSyncAttribKHR; + case 2042: return eglSetSwapRectangleANDROID; + case 2043: return eglGetRenderBufferANDROID; + case 2044: return eglGetSystemTimeFrequencyNV; + case 2045: return eglGetSystemTimeNV; + case 3000: return invalid; + case 3001: return frameBufferContents; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap<Function> + internalGetValueMap() { + return internalValueMap; + } + private static com.google.protobuf.Internal.EnumLiteMap<Function> + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap<Function>() { + public Function findValueByNumber(int number) { + return Function.valueOf(number) + ; } + }; + + private final int index; + private final int value; + private Function(int index, int value) { + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:android.gltrace.GLMessage.Function) + } + + public static final class DataType extends + com.google.protobuf.GeneratedMessageLite { + // Use DataType.newBuilder() to construct. + private DataType() { + initFields(); + } + private DataType(boolean noInit) {} + + private static final DataType defaultInstance; + public static DataType getDefaultInstance() { + return defaultInstance; + } + + public DataType getDefaultInstanceForType() { + return defaultInstance; + } + + public enum Type + implements com.google.protobuf.Internal.EnumLite { + VOID(0, 1), + CHAR(1, 2), + BYTE(2, 3), + INT(3, 4), + FLOAT(4, 5), + BOOL(5, 6), + ENUM(6, 7), + ; + + + public final int getNumber() { return value; } + + public static Type valueOf(int value) { + switch (value) { + case 1: return VOID; + case 2: return CHAR; + case 3: return BYTE; + case 4: return INT; + case 5: return FLOAT; + case 6: return BOOL; + case 7: return ENUM; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap<Type> + internalGetValueMap() { + return internalValueMap; + } + private static com.google.protobuf.Internal.EnumLiteMap<Type> + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap<Type>() { + public Type findValueByNumber(int number) { + return Type.valueOf(number) + ; } + }; + + private final int index; + private final int value; + private Type(int index, int value) { + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:android.gltrace.GLMessage.DataType.Type) + } + + // required .android.gltrace.GLMessage.DataType.Type type = 1 [default = VOID]; + public static final int TYPE_FIELD_NUMBER = 1; + private boolean hasType; + private com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.Type type_; + public boolean hasType() { return hasType; } + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.Type getType() { return type_; } + + // required bool isArray = 2 [default = false]; + public static final int ISARRAY_FIELD_NUMBER = 2; + private boolean hasIsArray; + private boolean isArray_ = false; + public boolean hasIsArray() { return hasIsArray; } + public boolean getIsArray() { return isArray_; } + + // repeated int32 intValue = 3; + public static final int INTVALUE_FIELD_NUMBER = 3; + private java.util.List<java.lang.Integer> intValue_ = + java.util.Collections.emptyList(); + public java.util.List<java.lang.Integer> getIntValueList() { + return intValue_; + } + public int getIntValueCount() { return intValue_.size(); } + public int getIntValue(int index) { + return intValue_.get(index); + } + + // repeated float floatValue = 4; + public static final int FLOATVALUE_FIELD_NUMBER = 4; + private java.util.List<java.lang.Float> floatValue_ = + java.util.Collections.emptyList(); + public java.util.List<java.lang.Float> getFloatValueList() { + return floatValue_; + } + public int getFloatValueCount() { return floatValue_.size(); } + public float getFloatValue(int index) { + return floatValue_.get(index); + } + + // repeated bytes charValue = 5; + public static final int CHARVALUE_FIELD_NUMBER = 5; + private java.util.List<com.google.protobuf.ByteString> charValue_ = + java.util.Collections.emptyList(); + public java.util.List<com.google.protobuf.ByteString> getCharValueList() { + return charValue_; + } + public int getCharValueCount() { return charValue_.size(); } + public com.google.protobuf.ByteString getCharValue(int index) { + return charValue_.get(index); + } + + // repeated bytes rawBytes = 6; + public static final int RAWBYTES_FIELD_NUMBER = 6; + private java.util.List<com.google.protobuf.ByteString> rawBytes_ = + java.util.Collections.emptyList(); + public java.util.List<com.google.protobuf.ByteString> getRawBytesList() { + return rawBytes_; + } + public int getRawBytesCount() { return rawBytes_.size(); } + public com.google.protobuf.ByteString getRawBytes(int index) { + return rawBytes_.get(index); + } + + // repeated bool boolValue = 7; + public static final int BOOLVALUE_FIELD_NUMBER = 7; + private java.util.List<java.lang.Boolean> boolValue_ = + java.util.Collections.emptyList(); + public java.util.List<java.lang.Boolean> getBoolValueList() { + return boolValue_; + } + public int getBoolValueCount() { return boolValue_.size(); } + public boolean getBoolValue(int index) { + return boolValue_.get(index); + } + + private void initFields() { + type_ = com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.Type.VOID; + } + public final boolean isInitialized() { + if (!hasType) return false; + if (!hasIsArray) return false; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (hasType()) { + output.writeEnum(1, getType().getNumber()); + } + if (hasIsArray()) { + output.writeBool(2, getIsArray()); + } + for (int element : getIntValueList()) { + output.writeInt32(3, element); + } + for (float element : getFloatValueList()) { + output.writeFloat(4, element); + } + for (com.google.protobuf.ByteString element : getCharValueList()) { + output.writeBytes(5, element); + } + for (com.google.protobuf.ByteString element : getRawBytesList()) { + output.writeBytes(6, element); + } + for (boolean element : getBoolValueList()) { + output.writeBool(7, element); + } + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasType()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, getType().getNumber()); + } + if (hasIsArray()) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, getIsArray()); + } + { + int dataSize = 0; + for (int element : getIntValueList()) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(element); + } + size += dataSize; + size += 1 * getIntValueList().size(); + } + { + int dataSize = 0; + dataSize = 4 * getFloatValueList().size(); + size += dataSize; + size += 1 * getFloatValueList().size(); + } + { + int dataSize = 0; + for (com.google.protobuf.ByteString element : getCharValueList()) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(element); + } + size += dataSize; + size += 1 * getCharValueList().size(); + } + { + int dataSize = 0; + for (com.google.protobuf.ByteString element : getRawBytesList()) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(element); + } + size += dataSize; + size += 1 * getRawBytesList().size(); + } + { + int dataSize = 0; + dataSize = 1 * getBoolValueList().size(); + size += dataSize; + size += 1 * getBoolValueList().size(); + } + memoizedSerializedSize = size; + return size; + } + + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType parseFrom(java.io.InputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input, extensionRegistry)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType, Builder> { + private com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType result; + + // Construct using com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.newBuilder() + private Builder() {} + + private static Builder create() { + Builder builder = new Builder(); + builder.result = new com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType(); + return builder; + } + + @Override + protected com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType internalGetResult() { + return result; + } + + public Builder clear() { + if (result == null) { + throw new IllegalStateException( + "Cannot call clear() after build()."); + } + result = new com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType(); + return this; + } + + @Override + public Builder clone() { + return create().mergeFrom(result); + } + + @Override + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType getDefaultInstanceForType() { + return com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.getDefaultInstance(); + } + + public boolean isInitialized() { + return result.isInitialized(); + } + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType build() { + if (result != null && !isInitialized()) { + throw newUninitializedMessageException(result); + } + return buildPartial(); + } + + private com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType buildParsed() + throws com.google.protobuf.InvalidProtocolBufferException { + if (!isInitialized()) { + throw newUninitializedMessageException( + result).asInvalidProtocolBufferException(); + } + return buildPartial(); + } + + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType buildPartial() { + if (result == null) { + throw new IllegalStateException( + "build() has already been called on this Builder."); + } + if (result.intValue_ != java.util.Collections.EMPTY_LIST) { + result.intValue_ = + java.util.Collections.unmodifiableList(result.intValue_); + } + if (result.floatValue_ != java.util.Collections.EMPTY_LIST) { + result.floatValue_ = + java.util.Collections.unmodifiableList(result.floatValue_); + } + if (result.charValue_ != java.util.Collections.EMPTY_LIST) { + result.charValue_ = + java.util.Collections.unmodifiableList(result.charValue_); + } + if (result.rawBytes_ != java.util.Collections.EMPTY_LIST) { + result.rawBytes_ = + java.util.Collections.unmodifiableList(result.rawBytes_); + } + if (result.boolValue_ != java.util.Collections.EMPTY_LIST) { + result.boolValue_ = + java.util.Collections.unmodifiableList(result.boolValue_); + } + com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType returnMe = result; + result = null; + return returnMe; + } + + @Override + public Builder mergeFrom(com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType other) { + if (other == com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.getDefaultInstance()) return this; + if (other.hasType()) { + setType(other.getType()); + } + if (other.hasIsArray()) { + setIsArray(other.getIsArray()); + } + if (!other.intValue_.isEmpty()) { + if (result.intValue_.isEmpty()) { + result.intValue_ = new java.util.ArrayList<java.lang.Integer>(); + } + result.intValue_.addAll(other.intValue_); + } + if (!other.floatValue_.isEmpty()) { + if (result.floatValue_.isEmpty()) { + result.floatValue_ = new java.util.ArrayList<java.lang.Float>(); + } + result.floatValue_.addAll(other.floatValue_); + } + if (!other.charValue_.isEmpty()) { + if (result.charValue_.isEmpty()) { + result.charValue_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); + } + result.charValue_.addAll(other.charValue_); + } + if (!other.rawBytes_.isEmpty()) { + if (result.rawBytes_.isEmpty()) { + result.rawBytes_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); + } + result.rawBytes_.addAll(other.rawBytes_); + } + if (!other.boolValue_.isEmpty()) { + if (result.boolValue_.isEmpty()) { + result.boolValue_ = new java.util.ArrayList<java.lang.Boolean>(); + } + result.boolValue_.addAll(other.boolValue_); + } + return this; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + while (true) { + int tag = input.readTag(); + switch (tag) { + case 0: + return this; + default: { + if (!parseUnknownField(input, extensionRegistry, tag)) { + return this; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.Type value = com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.Type.valueOf(rawValue); + if (value != null) { + setType(value); + } + break; + } + case 16: { + setIsArray(input.readBool()); + break; + } + case 24: { + addIntValue(input.readInt32()); + break; + } + case 26: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + addIntValue(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 37: { + addFloatValue(input.readFloat()); + break; + } + case 34: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + addFloatValue(input.readFloat()); + } + input.popLimit(limit); + break; + } + case 42: { + addCharValue(input.readBytes()); + break; + } + case 50: { + addRawBytes(input.readBytes()); + break; + } + case 56: { + addBoolValue(input.readBool()); + break; + } + case 58: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + addBoolValue(input.readBool()); + } + input.popLimit(limit); + break; + } + } + } + } + + + // required .android.gltrace.GLMessage.DataType.Type type = 1 [default = VOID]; + public boolean hasType() { + return result.hasType(); + } + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.Type getType() { + return result.getType(); + } + public Builder setType(com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.Type value) { + if (value == null) { + throw new NullPointerException(); + } + result.hasType = true; + result.type_ = value; + return this; + } + public Builder clearType() { + result.hasType = false; + result.type_ = com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.Type.VOID; + return this; + } + + // required bool isArray = 2 [default = false]; + public boolean hasIsArray() { + return result.hasIsArray(); + } + public boolean getIsArray() { + return result.getIsArray(); + } + public Builder setIsArray(boolean value) { + result.hasIsArray = true; + result.isArray_ = value; + return this; + } + public Builder clearIsArray() { + result.hasIsArray = false; + result.isArray_ = false; + return this; + } + + // repeated int32 intValue = 3; + public java.util.List<java.lang.Integer> getIntValueList() { + return java.util.Collections.unmodifiableList(result.intValue_); + } + public int getIntValueCount() { + return result.getIntValueCount(); + } + public int getIntValue(int index) { + return result.getIntValue(index); + } + public Builder setIntValue(int index, int value) { + result.intValue_.set(index, value); + return this; + } + public Builder addIntValue(int value) { + if (result.intValue_.isEmpty()) { + result.intValue_ = new java.util.ArrayList<java.lang.Integer>(); + } + result.intValue_.add(value); + return this; + } + public Builder addAllIntValue( + java.lang.Iterable<? extends java.lang.Integer> values) { + if (result.intValue_.isEmpty()) { + result.intValue_ = new java.util.ArrayList<java.lang.Integer>(); + } + super.addAll(values, result.intValue_); + return this; + } + public Builder clearIntValue() { + result.intValue_ = java.util.Collections.emptyList(); + return this; + } + + // repeated float floatValue = 4; + public java.util.List<java.lang.Float> getFloatValueList() { + return java.util.Collections.unmodifiableList(result.floatValue_); + } + public int getFloatValueCount() { + return result.getFloatValueCount(); + } + public float getFloatValue(int index) { + return result.getFloatValue(index); + } + public Builder setFloatValue(int index, float value) { + result.floatValue_.set(index, value); + return this; + } + public Builder addFloatValue(float value) { + if (result.floatValue_.isEmpty()) { + result.floatValue_ = new java.util.ArrayList<java.lang.Float>(); + } + result.floatValue_.add(value); + return this; + } + public Builder addAllFloatValue( + java.lang.Iterable<? extends java.lang.Float> values) { + if (result.floatValue_.isEmpty()) { + result.floatValue_ = new java.util.ArrayList<java.lang.Float>(); + } + super.addAll(values, result.floatValue_); + return this; + } + public Builder clearFloatValue() { + result.floatValue_ = java.util.Collections.emptyList(); + return this; + } + + // repeated bytes charValue = 5; + public java.util.List<com.google.protobuf.ByteString> getCharValueList() { + return java.util.Collections.unmodifiableList(result.charValue_); + } + public int getCharValueCount() { + return result.getCharValueCount(); + } + public com.google.protobuf.ByteString getCharValue(int index) { + return result.getCharValue(index); + } + public Builder setCharValue(int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + result.charValue_.set(index, value); + return this; + } + public Builder addCharValue(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + if (result.charValue_.isEmpty()) { + result.charValue_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); + } + result.charValue_.add(value); + return this; + } + public Builder addAllCharValue( + java.lang.Iterable<? extends com.google.protobuf.ByteString> values) { + if (result.charValue_.isEmpty()) { + result.charValue_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); + } + super.addAll(values, result.charValue_); + return this; + } + public Builder clearCharValue() { + result.charValue_ = java.util.Collections.emptyList(); + return this; + } + + // repeated bytes rawBytes = 6; + public java.util.List<com.google.protobuf.ByteString> getRawBytesList() { + return java.util.Collections.unmodifiableList(result.rawBytes_); + } + public int getRawBytesCount() { + return result.getRawBytesCount(); + } + public com.google.protobuf.ByteString getRawBytes(int index) { + return result.getRawBytes(index); + } + public Builder setRawBytes(int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + result.rawBytes_.set(index, value); + return this; + } + public Builder addRawBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + if (result.rawBytes_.isEmpty()) { + result.rawBytes_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); + } + result.rawBytes_.add(value); + return this; + } + public Builder addAllRawBytes( + java.lang.Iterable<? extends com.google.protobuf.ByteString> values) { + if (result.rawBytes_.isEmpty()) { + result.rawBytes_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); + } + super.addAll(values, result.rawBytes_); + return this; + } + public Builder clearRawBytes() { + result.rawBytes_ = java.util.Collections.emptyList(); + return this; + } + + // repeated bool boolValue = 7; + public java.util.List<java.lang.Boolean> getBoolValueList() { + return java.util.Collections.unmodifiableList(result.boolValue_); + } + public int getBoolValueCount() { + return result.getBoolValueCount(); + } + public boolean getBoolValue(int index) { + return result.getBoolValue(index); + } + public Builder setBoolValue(int index, boolean value) { + result.boolValue_.set(index, value); + return this; + } + public Builder addBoolValue(boolean value) { + if (result.boolValue_.isEmpty()) { + result.boolValue_ = new java.util.ArrayList<java.lang.Boolean>(); + } + result.boolValue_.add(value); + return this; + } + public Builder addAllBoolValue( + java.lang.Iterable<? extends java.lang.Boolean> values) { + if (result.boolValue_.isEmpty()) { + result.boolValue_ = new java.util.ArrayList<java.lang.Boolean>(); + } + super.addAll(values, result.boolValue_); + return this; + } + public Builder clearBoolValue() { + result.boolValue_ = java.util.Collections.emptyList(); + return this; + } + + // @@protoc_insertion_point(builder_scope:android.gltrace.GLMessage.DataType) + } + + static { + defaultInstance = new DataType(true); + com.android.ide.eclipse.gltrace.GLProtoBuf.internalForceInit(); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:android.gltrace.GLMessage.DataType) + } + + public static final class FrameBuffer extends + com.google.protobuf.GeneratedMessageLite { + // Use FrameBuffer.newBuilder() to construct. + private FrameBuffer() { + initFields(); + } + private FrameBuffer(boolean noInit) {} + + private static final FrameBuffer defaultInstance; + public static FrameBuffer getDefaultInstance() { + return defaultInstance; + } + + public FrameBuffer getDefaultInstanceForType() { + return defaultInstance; + } + + // required int32 width = 1; + public static final int WIDTH_FIELD_NUMBER = 1; + private boolean hasWidth; + private int width_ = 0; + public boolean hasWidth() { return hasWidth; } + public int getWidth() { return width_; } + + // required int32 height = 2; + public static final int HEIGHT_FIELD_NUMBER = 2; + private boolean hasHeight; + private int height_ = 0; + public boolean hasHeight() { return hasHeight; } + public int getHeight() { return height_; } + + // repeated bytes contents = 3; + public static final int CONTENTS_FIELD_NUMBER = 3; + private java.util.List<com.google.protobuf.ByteString> contents_ = + java.util.Collections.emptyList(); + public java.util.List<com.google.protobuf.ByteString> getContentsList() { + return contents_; + } + public int getContentsCount() { return contents_.size(); } + public com.google.protobuf.ByteString getContents(int index) { + return contents_.get(index); + } + + private void initFields() { + } + public final boolean isInitialized() { + if (!hasWidth) return false; + if (!hasHeight) return false; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (hasWidth()) { + output.writeInt32(1, getWidth()); + } + if (hasHeight()) { + output.writeInt32(2, getHeight()); + } + for (com.google.protobuf.ByteString element : getContentsList()) { + output.writeBytes(3, element); + } + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasWidth()) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, getWidth()); + } + if (hasHeight()) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, getHeight()); + } + { + int dataSize = 0; + for (com.google.protobuf.ByteString element : getContentsList()) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(element); + } + size += dataSize; + size += 1 * getContentsList().size(); + } + memoizedSerializedSize = size; + return size; + } + + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer parseFrom(java.io.InputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input, extensionRegistry)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer, Builder> { + private com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer result; + + // Construct using com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer.newBuilder() + private Builder() {} + + private static Builder create() { + Builder builder = new Builder(); + builder.result = new com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer(); + return builder; + } + + @Override + protected com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer internalGetResult() { + return result; + } + + public Builder clear() { + if (result == null) { + throw new IllegalStateException( + "Cannot call clear() after build()."); + } + result = new com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer(); + return this; + } + + @Override + public Builder clone() { + return create().mergeFrom(result); + } + + @Override + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer getDefaultInstanceForType() { + return com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer.getDefaultInstance(); + } + + public boolean isInitialized() { + return result.isInitialized(); + } + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer build() { + if (result != null && !isInitialized()) { + throw newUninitializedMessageException(result); + } + return buildPartial(); + } + + private com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer buildParsed() + throws com.google.protobuf.InvalidProtocolBufferException { + if (!isInitialized()) { + throw newUninitializedMessageException( + result).asInvalidProtocolBufferException(); + } + return buildPartial(); + } + + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer buildPartial() { + if (result == null) { + throw new IllegalStateException( + "build() has already been called on this Builder."); + } + if (result.contents_ != java.util.Collections.EMPTY_LIST) { + result.contents_ = + java.util.Collections.unmodifiableList(result.contents_); + } + com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer returnMe = result; + result = null; + return returnMe; + } + + @Override + public Builder mergeFrom(com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer other) { + if (other == com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer.getDefaultInstance()) return this; + if (other.hasWidth()) { + setWidth(other.getWidth()); + } + if (other.hasHeight()) { + setHeight(other.getHeight()); + } + if (!other.contents_.isEmpty()) { + if (result.contents_.isEmpty()) { + result.contents_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); + } + result.contents_.addAll(other.contents_); + } + return this; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + while (true) { + int tag = input.readTag(); + switch (tag) { + case 0: + return this; + default: { + if (!parseUnknownField(input, extensionRegistry, tag)) { + return this; + } + break; + } + case 8: { + setWidth(input.readInt32()); + break; + } + case 16: { + setHeight(input.readInt32()); + break; + } + case 26: { + addContents(input.readBytes()); + break; + } + } + } + } + + + // required int32 width = 1; + public boolean hasWidth() { + return result.hasWidth(); + } + public int getWidth() { + return result.getWidth(); + } + public Builder setWidth(int value) { + result.hasWidth = true; + result.width_ = value; + return this; + } + public Builder clearWidth() { + result.hasWidth = false; + result.width_ = 0; + return this; + } + + // required int32 height = 2; + public boolean hasHeight() { + return result.hasHeight(); + } + public int getHeight() { + return result.getHeight(); + } + public Builder setHeight(int value) { + result.hasHeight = true; + result.height_ = value; + return this; + } + public Builder clearHeight() { + result.hasHeight = false; + result.height_ = 0; + return this; + } + + // repeated bytes contents = 3; + public java.util.List<com.google.protobuf.ByteString> getContentsList() { + return java.util.Collections.unmodifiableList(result.contents_); + } + public int getContentsCount() { + return result.getContentsCount(); + } + public com.google.protobuf.ByteString getContents(int index) { + return result.getContents(index); + } + public Builder setContents(int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + result.contents_.set(index, value); + return this; + } + public Builder addContents(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + if (result.contents_.isEmpty()) { + result.contents_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); + } + result.contents_.add(value); + return this; + } + public Builder addAllContents( + java.lang.Iterable<? extends com.google.protobuf.ByteString> values) { + if (result.contents_.isEmpty()) { + result.contents_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); + } + super.addAll(values, result.contents_); + return this; + } + public Builder clearContents() { + result.contents_ = java.util.Collections.emptyList(); + return this; + } + + // @@protoc_insertion_point(builder_scope:android.gltrace.GLMessage.FrameBuffer) + } + + static { + defaultInstance = new FrameBuffer(true); + com.android.ide.eclipse.gltrace.GLProtoBuf.internalForceInit(); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:android.gltrace.GLMessage.FrameBuffer) + } + + // required int32 context_id = 1; + public static final int CONTEXT_ID_FIELD_NUMBER = 1; + private boolean hasContextId; + private int contextId_ = 0; + public boolean hasContextId() { return hasContextId; } + public int getContextId() { return contextId_; } + + // required .android.gltrace.GLMessage.Function function = 2 [default = invalid]; + public static final int FUNCTION_FIELD_NUMBER = 2; + private boolean hasFunction; + private com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.Function function_; + public boolean hasFunction() { return hasFunction; } + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.Function getFunction() { return function_; } + + // repeated .android.gltrace.GLMessage.DataType args = 3; + public static final int ARGS_FIELD_NUMBER = 3; + private java.util.List<com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType> args_ = + java.util.Collections.emptyList(); + public java.util.List<com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType> getArgsList() { + return args_; + } + public int getArgsCount() { return args_.size(); } + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType getArgs(int index) { + return args_.get(index); + } + + // optional .android.gltrace.GLMessage.DataType returnValue = 4; + public static final int RETURNVALUE_FIELD_NUMBER = 4; + private boolean hasReturnValue; + private com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType returnValue_; + public boolean hasReturnValue() { return hasReturnValue; } + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType getReturnValue() { return returnValue_; } + + // optional float duration = 5; + public static final int DURATION_FIELD_NUMBER = 5; + private boolean hasDuration; + private float duration_ = 0F; + public boolean hasDuration() { return hasDuration; } + public float getDuration() { return duration_; } + + // optional .android.gltrace.GLMessage.FrameBuffer fb = 6; + public static final int FB_FIELD_NUMBER = 6; + private boolean hasFb; + private com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer fb_; + public boolean hasFb() { return hasFb; } + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer getFb() { return fb_; } + + private void initFields() { + function_ = com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.Function.invalid; + returnValue_ = com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.getDefaultInstance(); + fb_ = com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer.getDefaultInstance(); + } + public final boolean isInitialized() { + if (!hasContextId) return false; + if (!hasFunction) return false; + for (com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType element : getArgsList()) { + if (!element.isInitialized()) return false; + } + if (hasReturnValue()) { + if (!getReturnValue().isInitialized()) return false; + } + if (hasFb()) { + if (!getFb().isInitialized()) return false; + } + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (hasContextId()) { + output.writeInt32(1, getContextId()); + } + if (hasFunction()) { + output.writeEnum(2, getFunction().getNumber()); + } + for (com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType element : getArgsList()) { + output.writeMessage(3, element); + } + if (hasReturnValue()) { + output.writeMessage(4, getReturnValue()); + } + if (hasDuration()) { + output.writeFloat(5, getDuration()); + } + if (hasFb()) { + output.writeMessage(6, getFb()); + } + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasContextId()) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, getContextId()); + } + if (hasFunction()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, getFunction().getNumber()); + } + for (com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType element : getArgsList()) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, element); + } + if (hasReturnValue()) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getReturnValue()); + } + if (hasDuration()) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(5, getDuration()); + } + if (hasFb()) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getFb()); + } + memoizedSerializedSize = size; + return size; + } + + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input, extensionRegistry)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage, Builder> { + private com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage result; + + // Construct using com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.newBuilder() + private Builder() {} + + private static Builder create() { + Builder builder = new Builder(); + builder.result = new com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage(); + return builder; + } + + @Override + protected com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage internalGetResult() { + return result; + } + + public Builder clear() { + if (result == null) { + throw new IllegalStateException( + "Cannot call clear() after build()."); + } + result = new com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage(); + return this; + } + + @Override + public Builder clone() { + return create().mergeFrom(result); + } + + @Override + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage getDefaultInstanceForType() { + return com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.getDefaultInstance(); + } + + public boolean isInitialized() { + return result.isInitialized(); + } + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage build() { + if (result != null && !isInitialized()) { + throw newUninitializedMessageException(result); + } + return buildPartial(); + } + + private com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage buildParsed() + throws com.google.protobuf.InvalidProtocolBufferException { + if (!isInitialized()) { + throw newUninitializedMessageException( + result).asInvalidProtocolBufferException(); + } + return buildPartial(); + } + + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage buildPartial() { + if (result == null) { + throw new IllegalStateException( + "build() has already been called on this Builder."); + } + if (result.args_ != java.util.Collections.EMPTY_LIST) { + result.args_ = + java.util.Collections.unmodifiableList(result.args_); + } + com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage returnMe = result; + result = null; + return returnMe; + } + + @Override + public Builder mergeFrom(com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage other) { + if (other == com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.getDefaultInstance()) return this; + if (other.hasContextId()) { + setContextId(other.getContextId()); + } + if (other.hasFunction()) { + setFunction(other.getFunction()); + } + if (!other.args_.isEmpty()) { + if (result.args_.isEmpty()) { + result.args_ = new java.util.ArrayList<com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType>(); + } + result.args_.addAll(other.args_); + } + if (other.hasReturnValue()) { + mergeReturnValue(other.getReturnValue()); + } + if (other.hasDuration()) { + setDuration(other.getDuration()); + } + if (other.hasFb()) { + mergeFb(other.getFb()); + } + return this; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + while (true) { + int tag = input.readTag(); + switch (tag) { + case 0: + return this; + default: { + if (!parseUnknownField(input, extensionRegistry, tag)) { + return this; + } + break; + } + case 8: { + setContextId(input.readInt32()); + break; + } + case 16: { + int rawValue = input.readEnum(); + com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.Function value = com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.Function.valueOf(rawValue); + if (value != null) { + setFunction(value); + } + break; + } + case 26: { + com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.Builder subBuilder = com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.newBuilder(); + input.readMessage(subBuilder, extensionRegistry); + addArgs(subBuilder.buildPartial()); + break; + } + case 34: { + com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.Builder subBuilder = com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.newBuilder(); + if (hasReturnValue()) { + subBuilder.mergeFrom(getReturnValue()); + } + input.readMessage(subBuilder, extensionRegistry); + setReturnValue(subBuilder.buildPartial()); + break; + } + case 45: { + setDuration(input.readFloat()); + break; + } + case 50: { + com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer.Builder subBuilder = com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer.newBuilder(); + if (hasFb()) { + subBuilder.mergeFrom(getFb()); + } + input.readMessage(subBuilder, extensionRegistry); + setFb(subBuilder.buildPartial()); + break; + } + } + } + } + + + // required int32 context_id = 1; + public boolean hasContextId() { + return result.hasContextId(); + } + public int getContextId() { + return result.getContextId(); + } + public Builder setContextId(int value) { + result.hasContextId = true; + result.contextId_ = value; + return this; + } + public Builder clearContextId() { + result.hasContextId = false; + result.contextId_ = 0; + return this; + } + + // required .android.gltrace.GLMessage.Function function = 2 [default = invalid]; + public boolean hasFunction() { + return result.hasFunction(); + } + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.Function getFunction() { + return result.getFunction(); + } + public Builder setFunction(com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.Function value) { + if (value == null) { + throw new NullPointerException(); + } + result.hasFunction = true; + result.function_ = value; + return this; + } + public Builder clearFunction() { + result.hasFunction = false; + result.function_ = com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.Function.invalid; + return this; + } + + // repeated .android.gltrace.GLMessage.DataType args = 3; + public java.util.List<com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType> getArgsList() { + return java.util.Collections.unmodifiableList(result.args_); + } + public int getArgsCount() { + return result.getArgsCount(); + } + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType getArgs(int index) { + return result.getArgs(index); + } + public Builder setArgs(int index, com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + result.args_.set(index, value); + return this; + } + public Builder setArgs(int index, com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.Builder builderForValue) { + result.args_.set(index, builderForValue.build()); + return this; + } + public Builder addArgs(com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + if (result.args_.isEmpty()) { + result.args_ = new java.util.ArrayList<com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType>(); + } + result.args_.add(value); + return this; + } + public Builder addArgs(com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.Builder builderForValue) { + if (result.args_.isEmpty()) { + result.args_ = new java.util.ArrayList<com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType>(); + } + result.args_.add(builderForValue.build()); + return this; + } + public Builder addAllArgs( + java.lang.Iterable<? extends com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType> values) { + if (result.args_.isEmpty()) { + result.args_ = new java.util.ArrayList<com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType>(); + } + super.addAll(values, result.args_); + return this; + } + public Builder clearArgs() { + result.args_ = java.util.Collections.emptyList(); + return this; + } + + // optional .android.gltrace.GLMessage.DataType returnValue = 4; + public boolean hasReturnValue() { + return result.hasReturnValue(); + } + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType getReturnValue() { + return result.getReturnValue(); + } + public Builder setReturnValue(com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + result.hasReturnValue = true; + result.returnValue_ = value; + return this; + } + public Builder setReturnValue(com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.Builder builderForValue) { + result.hasReturnValue = true; + result.returnValue_ = builderForValue.build(); + return this; + } + public Builder mergeReturnValue(com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType value) { + if (result.hasReturnValue() && + result.returnValue_ != com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.getDefaultInstance()) { + result.returnValue_ = + com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.newBuilder(result.returnValue_).mergeFrom(value).buildPartial(); + } else { + result.returnValue_ = value; + } + result.hasReturnValue = true; + return this; + } + public Builder clearReturnValue() { + result.hasReturnValue = false; + result.returnValue_ = com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType.getDefaultInstance(); + return this; + } + + // optional float duration = 5; + public boolean hasDuration() { + return result.hasDuration(); + } + public float getDuration() { + return result.getDuration(); + } + public Builder setDuration(float value) { + result.hasDuration = true; + result.duration_ = value; + return this; + } + public Builder clearDuration() { + result.hasDuration = false; + result.duration_ = 0F; + return this; + } + + // optional .android.gltrace.GLMessage.FrameBuffer fb = 6; + public boolean hasFb() { + return result.hasFb(); + } + public com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer getFb() { + return result.getFb(); + } + public Builder setFb(com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer value) { + if (value == null) { + throw new NullPointerException(); + } + result.hasFb = true; + result.fb_ = value; + return this; + } + public Builder setFb(com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer.Builder builderForValue) { + result.hasFb = true; + result.fb_ = builderForValue.build(); + return this; + } + public Builder mergeFb(com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer value) { + if (result.hasFb() && + result.fb_ != com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer.getDefaultInstance()) { + result.fb_ = + com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer.newBuilder(result.fb_).mergeFrom(value).buildPartial(); + } else { + result.fb_ = value; + } + result.hasFb = true; + return this; + } + public Builder clearFb() { + result.hasFb = false; + result.fb_ = com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.FrameBuffer.getDefaultInstance(); + return this; + } + + // @@protoc_insertion_point(builder_scope:android.gltrace.GLMessage) + } + + static { + defaultInstance = new GLMessage(true); + com.android.ide.eclipse.gltrace.GLProtoBuf.internalForceInit(); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:android.gltrace.GLMessage) + } + + + static { + } + + public static void internalForceInit() {} + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLTraceReader.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLTraceReader.java deleted file mode 100644 index 9dac30f..0000000 --- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLTraceReader.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 - * - * 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.gltrace; - -import com.android.ide.eclipse.gltrace.Glcall.GLCall; -import com.android.ide.eclipse.gltrace.Glcall.GLCall.Function; -import com.google.protobuf.InvalidProtocolBufferException; - -import java.io.DataInputStream; -import java.io.EOFException; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; - -/** - * Read a file containing encoded GL Trace information and create the in memory model in - * {@link GLTrace}. - */ -public class GLTraceReader { - DataInputStream fs; - - public GLTraceReader(String fname) { - try { - fs = new DataInputStream(new FileInputStream(fname)); - } catch (FileNotFoundException e) { - throw new IllegalArgumentException(e); - } - } - - private GLCall getNextMessage() { - int len; - byte[] b; - try { - len = fs.readInt(); - b = new byte[len]; - fs.read(b, 0, len); - } catch (EOFException e) { - return null; - } catch (IOException e) { - return null; - } - - try { - return GLCall.parseFrom(b); - } catch (InvalidProtocolBufferException e) { - e.printStackTrace(); - return null; - } - } - - public GLTrace parseTrace() { - GLTrace trace = new GLTrace(); - - GLCall c = null; - GLFrame frame = null; - - while ((c = getNextMessage()) != null) { - if (frame == null) { - frame = new GLFrame(); - } - - frame.addGLCall(c); - - if (c.getFunction() == Function.eglSwapBuffers) { - trace.addGLFrame(frame); - frame = null; - } - } - - return trace; - } -} diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLTraceWriter.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLTraceWriter.java index 7104d3b..d57d677 100644 --- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLTraceWriter.java +++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLTraceWriter.java @@ -16,7 +16,7 @@ package com.android.ide.eclipse.gltrace; -import com.android.ide.eclipse.gltrace.Glcall.GLCall; +import com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage; import com.google.protobuf.InvalidProtocolBufferException; import java.io.DataInputStream; @@ -115,9 +115,9 @@ public class GLTraceWriter { } } - GLCall msg = null; + GLMessage msg = null; try { - msg = GLCall.parseFrom(buffer); + msg = GLMessage.parseFrom(buffer); } catch (InvalidProtocolBufferException e) { System.out.println("Invalid protocol buffer: " + e.getMessage()); return; @@ -127,7 +127,7 @@ public class GLTraceWriter { mFileSize += readLen; - if (msg.getFunction() == GLCall.Function.eglSwapBuffers) { + if (msg.getFunction() == GLMessage.Function.eglSwapBuffers) { mFrameCount++; } } diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/Glcall.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/Glcall.java deleted file mode 100644 index 08ab4cb..0000000 --- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/Glcall.java +++ /dev/null @@ -1,1700 +0,0 @@ -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// IMPORTANT NOTE: This file is named Glcall.java, but it probably should be GLCall.java. -// But please do not change the file name's case. This breaks git clients on Windows. -// source: glcall.proto - -package com.android.ide.eclipse.gltrace; - -public final class Glcall { - private Glcall() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - public static final class GLCall extends - com.google.protobuf.GeneratedMessageLite { - // Use GLCall.newBuilder() to construct. - private GLCall() { - initFields(); - } - private GLCall(boolean noInit) {} - - private static final GLCall defaultInstance; - public static GLCall getDefaultInstance() { - return defaultInstance; - } - - public GLCall getDefaultInstanceForType() { - return defaultInstance; - } - - public enum Function - implements com.google.protobuf.Internal.EnumLite { - glActiveTexture(0, 0), - glAttachShader(1, 1), - glBindAttribLocation(2, 2), - glBindBuffer(3, 3), - glBindFramebuffer(4, 4), - glBindRenderbuffer(5, 5), - glBindTexture(6, 6), - glBlendColor(7, 7), - glBlendEquation(8, 8), - glBlendEquationSeparate(9, 9), - glBlendFunc(10, 10), - glBlendFuncSeparate(11, 11), - glBufferData(12, 12), - glBufferSubData(13, 13), - glCheckFramebufferStatus(14, 14), - glClear(15, 15), - glClearColor(16, 16), - glClearDepthf(17, 17), - glClearStencil(18, 18), - glColorMask(19, 19), - glCompileShader(20, 20), - glCompressedTexImage2D(21, 21), - glCompressedTexSubImage2D(22, 22), - glCopyTexImage2D(23, 23), - glCopyTexSubImage2D(24, 24), - glCreateProgram(25, 25), - glCreateShader(26, 26), - glCullFace(27, 27), - glDeleteBuffers(28, 28), - glDeleteFramebuffers(29, 29), - glDeleteProgram(30, 30), - glDeleteRenderbuffers(31, 31), - glDeleteShader(32, 32), - glDeleteTextures(33, 33), - glDepthFunc(34, 34), - glDepthMask(35, 35), - glDepthRangef(36, 36), - glDetachShader(37, 37), - glDisable(38, 38), - glDisableVertexAttribArray(39, 39), - glDrawArrays(40, 40), - glDrawElements(41, 41), - glEnable(42, 42), - glEnableVertexAttribArray(43, 43), - glFinish(44, 44), - glFlush(45, 45), - glFramebufferRenderbuffer(46, 46), - glFramebufferTexture2D(47, 47), - glFrontFace(48, 48), - glGenBuffers(49, 49), - glGenerateMipmap(50, 50), - glGenFramebuffers(51, 51), - glGenRenderbuffers(52, 52), - glGenTextures(53, 53), - glGetActiveAttrib(54, 54), - glGetActiveUniform(55, 55), - glGetAttachedShaders(56, 56), - glGetAttribLocation(57, 57), - glGetBooleanv(58, 58), - glGetBufferParameteriv(59, 59), - glGetError(60, 60), - glGetFloatv(61, 61), - glGetFramebufferAttachmentParameteriv(62, 62), - glGetIntegerv(63, 63), - glGetProgramiv(64, 64), - glGetProgramInfoLog(65, 65), - glGetRenderbufferParameteriv(66, 66), - glGetShaderiv(67, 67), - glGetShaderInfoLog(68, 68), - glGetShaderPrecisionFormat(69, 69), - glGetShaderSource(70, 70), - glGetString(71, 71), - glGetTexParameterfv(72, 72), - glGetTexParameteriv(73, 73), - glGetUniformfv(74, 74), - glGetUniformiv(75, 75), - glGetUniformLocation(76, 76), - glGetVertexAttribfv(77, 77), - glGetVertexAttribiv(78, 78), - glGetVertexAttribPointerv(79, 79), - glHint(80, 80), - glIsBuffer(81, 81), - glIsEnabled(82, 82), - glIsFramebuffer(83, 83), - glIsProgram(84, 84), - glIsRenderbuffer(85, 85), - glIsShader(86, 86), - glIsTexture(87, 87), - glLineWidth(88, 88), - glLinkProgram(89, 89), - glPixelStorei(90, 90), - glPolygonOffset(91, 91), - glReadPixels(92, 92), - glReleaseShaderCompiler(93, 93), - glRenderbufferStorage(94, 94), - glSampleCoverage(95, 95), - glScissor(96, 96), - glShaderBinary(97, 97), - glShaderSource(98, 98), - glStencilFunc(99, 99), - glStencilFuncSeparate(100, 100), - glStencilMask(101, 101), - glStencilMaskSeparate(102, 102), - glStencilOp(103, 103), - glStencilOpSeparate(104, 104), - glTexImage2D(105, 105), - glTexParameterf(106, 106), - glTexParameterfv(107, 107), - glTexParameteri(108, 108), - glTexParameteriv(109, 109), - glTexSubImage2D(110, 110), - glUniform1f(111, 111), - glUniform1fv(112, 112), - glUniform1i(113, 113), - glUniform1iv(114, 114), - glUniform2f(115, 115), - glUniform2fv(116, 116), - glUniform2i(117, 117), - glUniform2iv(118, 118), - glUniform3f(119, 119), - glUniform3fv(120, 120), - glUniform3i(121, 121), - glUniform3iv(122, 122), - glUniform4f(123, 123), - glUniform4fv(124, 124), - glUniform4i(125, 125), - glUniform4iv(126, 126), - glUniformMatrix2fv(127, 127), - glUniformMatrix3fv(128, 128), - glUniformMatrix4fv(129, 129), - glUseProgram(130, 130), - glValidateProgram(131, 131), - glVertexAttrib1f(132, 132), - glVertexAttrib1fv(133, 133), - glVertexAttrib2f(134, 134), - glVertexAttrib2fv(135, 135), - glVertexAttrib3f(136, 136), - glVertexAttrib3fv(137, 137), - glVertexAttrib4f(138, 138), - glVertexAttrib4fv(139, 139), - glVertexAttribPointer(140, 140), - glViewport(141, 141), - eglGetDisplay(142, 200), - eglInitialize(143, 201), - eglTerminate(144, 202), - eglGetConfigs(145, 203), - eglChooseConfig(146, 204), - eglGetConfigAttrib(147, 205), - eglCreateWindowSurface(148, 206), - eglCreatePixmapSurface(149, 207), - eglCreatePbufferSurface(150, 208), - eglDestroySurface(151, 209), - eglQuerySurface(152, 210), - eglCreateContext(153, 211), - eglDestroyContext(154, 212), - eglMakeCurrent(155, 213), - eglGetCurrentContext(156, 214), - eglGetCurrentSurface(157, 215), - eglGetCurrentDisplay(158, 216), - eglQueryContext(159, 217), - eglWaitGL(160, 218), - eglWaitNative(161, 219), - eglSwapBuffers(162, 220), - eglCopyBuffers(163, 221), - eglGetError(164, 222), - eglQueryString(165, 223), - eglGetProcAddress(166, 224), - eglSurfaceAttrib(167, 225), - eglBindTexImage(168, 226), - eglReleaseTexImage(169, 227), - eglSwapInterval(170, 228), - eglBindAPI(171, 229), - eglQueryAPI(172, 230), - eglWaitClient(173, 231), - eglReleaseThread(174, 232), - eglCreatePbufferFromClientBuffer(175, 233), - eglLockSurfaceKHR(176, 234), - eglUnlockSurfaceKHR(177, 235), - eglCreateImageKHR(178, 236), - eglDestroyImageKHR(179, 237), - eglCreateSyncKHR(180, 238), - eglDestroySyncKHR(181, 239), - eglClientWaitSyncKHR(182, 240), - eglGetSyncAttribKHR(183, 241), - eglSetSwapRectangleANDROID(184, 242), - eglGetRenderBufferANDROID(185, 243), - eglGetSystemTimeFrequencyNV(186, 244), - eglGetSystemTimeNV(187, 245), - invalid(188, 300), - frameBufferContents(189, 301), - ; - - - public final int getNumber() { return value; } - - public static Function valueOf(int value) { - switch (value) { - case 0: return glActiveTexture; - case 1: return glAttachShader; - case 2: return glBindAttribLocation; - case 3: return glBindBuffer; - case 4: return glBindFramebuffer; - case 5: return glBindRenderbuffer; - case 6: return glBindTexture; - case 7: return glBlendColor; - case 8: return glBlendEquation; - case 9: return glBlendEquationSeparate; - case 10: return glBlendFunc; - case 11: return glBlendFuncSeparate; - case 12: return glBufferData; - case 13: return glBufferSubData; - case 14: return glCheckFramebufferStatus; - case 15: return glClear; - case 16: return glClearColor; - case 17: return glClearDepthf; - case 18: return glClearStencil; - case 19: return glColorMask; - case 20: return glCompileShader; - case 21: return glCompressedTexImage2D; - case 22: return glCompressedTexSubImage2D; - case 23: return glCopyTexImage2D; - case 24: return glCopyTexSubImage2D; - case 25: return glCreateProgram; - case 26: return glCreateShader; - case 27: return glCullFace; - case 28: return glDeleteBuffers; - case 29: return glDeleteFramebuffers; - case 30: return glDeleteProgram; - case 31: return glDeleteRenderbuffers; - case 32: return glDeleteShader; - case 33: return glDeleteTextures; - case 34: return glDepthFunc; - case 35: return glDepthMask; - case 36: return glDepthRangef; - case 37: return glDetachShader; - case 38: return glDisable; - case 39: return glDisableVertexAttribArray; - case 40: return glDrawArrays; - case 41: return glDrawElements; - case 42: return glEnable; - case 43: return glEnableVertexAttribArray; - case 44: return glFinish; - case 45: return glFlush; - case 46: return glFramebufferRenderbuffer; - case 47: return glFramebufferTexture2D; - case 48: return glFrontFace; - case 49: return glGenBuffers; - case 50: return glGenerateMipmap; - case 51: return glGenFramebuffers; - case 52: return glGenRenderbuffers; - case 53: return glGenTextures; - case 54: return glGetActiveAttrib; - case 55: return glGetActiveUniform; - case 56: return glGetAttachedShaders; - case 57: return glGetAttribLocation; - case 58: return glGetBooleanv; - case 59: return glGetBufferParameteriv; - case 60: return glGetError; - case 61: return glGetFloatv; - case 62: return glGetFramebufferAttachmentParameteriv; - case 63: return glGetIntegerv; - case 64: return glGetProgramiv; - case 65: return glGetProgramInfoLog; - case 66: return glGetRenderbufferParameteriv; - case 67: return glGetShaderiv; - case 68: return glGetShaderInfoLog; - case 69: return glGetShaderPrecisionFormat; - case 70: return glGetShaderSource; - case 71: return glGetString; - case 72: return glGetTexParameterfv; - case 73: return glGetTexParameteriv; - case 74: return glGetUniformfv; - case 75: return glGetUniformiv; - case 76: return glGetUniformLocation; - case 77: return glGetVertexAttribfv; - case 78: return glGetVertexAttribiv; - case 79: return glGetVertexAttribPointerv; - case 80: return glHint; - case 81: return glIsBuffer; - case 82: return glIsEnabled; - case 83: return glIsFramebuffer; - case 84: return glIsProgram; - case 85: return glIsRenderbuffer; - case 86: return glIsShader; - case 87: return glIsTexture; - case 88: return glLineWidth; - case 89: return glLinkProgram; - case 90: return glPixelStorei; - case 91: return glPolygonOffset; - case 92: return glReadPixels; - case 93: return glReleaseShaderCompiler; - case 94: return glRenderbufferStorage; - case 95: return glSampleCoverage; - case 96: return glScissor; - case 97: return glShaderBinary; - case 98: return glShaderSource; - case 99: return glStencilFunc; - case 100: return glStencilFuncSeparate; - case 101: return glStencilMask; - case 102: return glStencilMaskSeparate; - case 103: return glStencilOp; - case 104: return glStencilOpSeparate; - case 105: return glTexImage2D; - case 106: return glTexParameterf; - case 107: return glTexParameterfv; - case 108: return glTexParameteri; - case 109: return glTexParameteriv; - case 110: return glTexSubImage2D; - case 111: return glUniform1f; - case 112: return glUniform1fv; - case 113: return glUniform1i; - case 114: return glUniform1iv; - case 115: return glUniform2f; - case 116: return glUniform2fv; - case 117: return glUniform2i; - case 118: return glUniform2iv; - case 119: return glUniform3f; - case 120: return glUniform3fv; - case 121: return glUniform3i; - case 122: return glUniform3iv; - case 123: return glUniform4f; - case 124: return glUniform4fv; - case 125: return glUniform4i; - case 126: return glUniform4iv; - case 127: return glUniformMatrix2fv; - case 128: return glUniformMatrix3fv; - case 129: return glUniformMatrix4fv; - case 130: return glUseProgram; - case 131: return glValidateProgram; - case 132: return glVertexAttrib1f; - case 133: return glVertexAttrib1fv; - case 134: return glVertexAttrib2f; - case 135: return glVertexAttrib2fv; - case 136: return glVertexAttrib3f; - case 137: return glVertexAttrib3fv; - case 138: return glVertexAttrib4f; - case 139: return glVertexAttrib4fv; - case 140: return glVertexAttribPointer; - case 141: return glViewport; - case 200: return eglGetDisplay; - case 201: return eglInitialize; - case 202: return eglTerminate; - case 203: return eglGetConfigs; - case 204: return eglChooseConfig; - case 205: return eglGetConfigAttrib; - case 206: return eglCreateWindowSurface; - case 207: return eglCreatePixmapSurface; - case 208: return eglCreatePbufferSurface; - case 209: return eglDestroySurface; - case 210: return eglQuerySurface; - case 211: return eglCreateContext; - case 212: return eglDestroyContext; - case 213: return eglMakeCurrent; - case 214: return eglGetCurrentContext; - case 215: return eglGetCurrentSurface; - case 216: return eglGetCurrentDisplay; - case 217: return eglQueryContext; - case 218: return eglWaitGL; - case 219: return eglWaitNative; - case 220: return eglSwapBuffers; - case 221: return eglCopyBuffers; - case 222: return eglGetError; - case 223: return eglQueryString; - case 224: return eglGetProcAddress; - case 225: return eglSurfaceAttrib; - case 226: return eglBindTexImage; - case 227: return eglReleaseTexImage; - case 228: return eglSwapInterval; - case 229: return eglBindAPI; - case 230: return eglQueryAPI; - case 231: return eglWaitClient; - case 232: return eglReleaseThread; - case 233: return eglCreatePbufferFromClientBuffer; - case 234: return eglLockSurfaceKHR; - case 235: return eglUnlockSurfaceKHR; - case 236: return eglCreateImageKHR; - case 237: return eglDestroyImageKHR; - case 238: return eglCreateSyncKHR; - case 239: return eglDestroySyncKHR; - case 240: return eglClientWaitSyncKHR; - case 241: return eglGetSyncAttribKHR; - case 242: return eglSetSwapRectangleANDROID; - case 243: return eglGetRenderBufferANDROID; - case 244: return eglGetSystemTimeFrequencyNV; - case 245: return eglGetSystemTimeNV; - case 300: return invalid; - case 301: return frameBufferContents; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap<Function> - internalGetValueMap() { - return internalValueMap; - } - private static com.google.protobuf.Internal.EnumLiteMap<Function> - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap<Function>() { - public Function findValueByNumber(int number) { - return Function.valueOf(number) - ; } - }; - - private final int index; - private final int value; - private Function(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:com.android.gltrace.GLCall.Function) - } - - public static final class DataType extends - com.google.protobuf.GeneratedMessageLite { - // Use DataType.newBuilder() to construct. - private DataType() { - initFields(); - } - private DataType(boolean noInit) {} - - private static final DataType defaultInstance; - public static DataType getDefaultInstance() { - return defaultInstance; - } - - public DataType getDefaultInstanceForType() { - return defaultInstance; - } - - public enum Type - implements com.google.protobuf.Internal.EnumLite { - VOID(0, 1), - CHAR(1, 2), - BYTE(2, 3), - INT(3, 4), - FLOAT(4, 5), - BOOLEAN(5, 6), - ENUM(6, 7), - ; - - - public final int getNumber() { return value; } - - public static Type valueOf(int value) { - switch (value) { - case 1: return VOID; - case 2: return CHAR; - case 3: return BYTE; - case 4: return INT; - case 5: return FLOAT; - case 6: return BOOLEAN; - case 7: return ENUM; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap<Type> - internalGetValueMap() { - return internalValueMap; - } - private static com.google.protobuf.Internal.EnumLiteMap<Type> - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap<Type>() { - public Type findValueByNumber(int number) { - return Type.valueOf(number) - ; } - }; - - private final int index; - private final int value; - private Type(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:com.android.gltrace.GLCall.DataType.Type) - } - - // required .com.android.gltrace.GLCall.DataType.Type type = 1 [default = VOID]; - public static final int TYPE_FIELD_NUMBER = 1; - private boolean hasType; - private com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.Type type_; - public boolean hasType() { return hasType; } - public com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.Type getType() { return type_; } - - // required bool isArray = 2 [default = false]; - public static final int ISARRAY_FIELD_NUMBER = 2; - private boolean hasIsArray; - private boolean isArray_ = false; - public boolean hasIsArray() { return hasIsArray; } - public boolean getIsArray() { return isArray_; } - - // repeated int32 intValue = 3; - public static final int INTVALUE_FIELD_NUMBER = 3; - private java.util.List<java.lang.Integer> intValue_ = - java.util.Collections.emptyList(); - public java.util.List<java.lang.Integer> getIntValueList() { - return intValue_; - } - public int getIntValueCount() { return intValue_.size(); } - public int getIntValue(int index) { - return intValue_.get(index); - } - - // repeated float floatValue = 4; - public static final int FLOATVALUE_FIELD_NUMBER = 4; - private java.util.List<java.lang.Float> floatValue_ = - java.util.Collections.emptyList(); - public java.util.List<java.lang.Float> getFloatValueList() { - return floatValue_; - } - public int getFloatValueCount() { return floatValue_.size(); } - public float getFloatValue(int index) { - return floatValue_.get(index); - } - - // repeated bytes charValue = 5; - public static final int CHARVALUE_FIELD_NUMBER = 5; - private java.util.List<com.google.protobuf.ByteString> charValue_ = - java.util.Collections.emptyList(); - public java.util.List<com.google.protobuf.ByteString> getCharValueList() { - return charValue_; - } - public int getCharValueCount() { return charValue_.size(); } - public com.google.protobuf.ByteString getCharValue(int index) { - return charValue_.get(index); - } - - // repeated bytes rawBytes = 6; - public static final int RAWBYTES_FIELD_NUMBER = 6; - private java.util.List<com.google.protobuf.ByteString> rawBytes_ = - java.util.Collections.emptyList(); - public java.util.List<com.google.protobuf.ByteString> getRawBytesList() { - return rawBytes_; - } - public int getRawBytesCount() { return rawBytes_.size(); } - public com.google.protobuf.ByteString getRawBytes(int index) { - return rawBytes_.get(index); - } - - // repeated bool boolValue = 7; - public static final int BOOLVALUE_FIELD_NUMBER = 7; - private java.util.List<java.lang.Boolean> boolValue_ = - java.util.Collections.emptyList(); - public java.util.List<java.lang.Boolean> getBoolValueList() { - return boolValue_; - } - public int getBoolValueCount() { return boolValue_.size(); } - public boolean getBoolValue(int index) { - return boolValue_.get(index); - } - - private void initFields() { - type_ = com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.Type.VOID; - } - public final boolean isInitialized() { - if (!hasType) return false; - if (!hasIsArray) return false; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (hasType()) { - output.writeEnum(1, getType().getNumber()); - } - if (hasIsArray()) { - output.writeBool(2, getIsArray()); - } - for (int element : getIntValueList()) { - output.writeInt32(3, element); - } - for (float element : getFloatValueList()) { - output.writeFloat(4, element); - } - for (com.google.protobuf.ByteString element : getCharValueList()) { - output.writeBytes(5, element); - } - for (com.google.protobuf.ByteString element : getRawBytesList()) { - output.writeBytes(6, element); - } - for (boolean element : getBoolValueList()) { - output.writeBool(7, element); - } - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasType()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, getType().getNumber()); - } - if (hasIsArray()) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(2, getIsArray()); - } - { - int dataSize = 0; - for (int element : getIntValueList()) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(element); - } - size += dataSize; - size += 1 * getIntValueList().size(); - } - { - int dataSize = 0; - dataSize = 4 * getFloatValueList().size(); - size += dataSize; - size += 1 * getFloatValueList().size(); - } - { - int dataSize = 0; - for (com.google.protobuf.ByteString element : getCharValueList()) { - dataSize += com.google.protobuf.CodedOutputStream - .computeBytesSizeNoTag(element); - } - size += dataSize; - size += 1 * getCharValueList().size(); - } - { - int dataSize = 0; - for (com.google.protobuf.ByteString element : getRawBytesList()) { - dataSize += com.google.protobuf.CodedOutputStream - .computeBytesSizeNoTag(element); - } - size += dataSize; - size += 1 * getRawBytesList().size(); - } - { - int dataSize = 0; - dataSize = 1 * getBoolValueList().size(); - size += dataSize; - size += 1 * getBoolValueList().size(); - } - memoizedSerializedSize = size; - return size; - } - - public static com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType, Builder> { - private com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType result; - - // Construct using com.android.gltrace.Glcall.GLCall.DataType.newBuilder() - private Builder() {} - - private static Builder create() { - Builder builder = new Builder(); - builder.result = new com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType(); - return builder; - } - - @Override - protected com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType internalGetResult() { - return result; - } - - public Builder clear() { - if (result == null) { - throw new IllegalStateException( - "Cannot call clear() after build()."); - } - result = new com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType(); - return this; - } - - @Override - public Builder clone() { - return create().mergeFrom(result); - } - - @Override - public com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType getDefaultInstanceForType() { - return com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.getDefaultInstance(); - } - - public boolean isInitialized() { - return result.isInitialized(); - } - public com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType build() { - if (result != null && !isInitialized()) { - throw newUninitializedMessageException(result); - } - return buildPartial(); - } - - private com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return buildPartial(); - } - - public com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); - } - if (result.intValue_ != java.util.Collections.EMPTY_LIST) { - result.intValue_ = - java.util.Collections.unmodifiableList(result.intValue_); - } - if (result.floatValue_ != java.util.Collections.EMPTY_LIST) { - result.floatValue_ = - java.util.Collections.unmodifiableList(result.floatValue_); - } - if (result.charValue_ != java.util.Collections.EMPTY_LIST) { - result.charValue_ = - java.util.Collections.unmodifiableList(result.charValue_); - } - if (result.rawBytes_ != java.util.Collections.EMPTY_LIST) { - result.rawBytes_ = - java.util.Collections.unmodifiableList(result.rawBytes_); - } - if (result.boolValue_ != java.util.Collections.EMPTY_LIST) { - result.boolValue_ = - java.util.Collections.unmodifiableList(result.boolValue_); - } - com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType returnMe = result; - result = null; - return returnMe; - } - - @Override - public Builder mergeFrom(com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType other) { - if (other == com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.getDefaultInstance()) return this; - if (other.hasType()) { - setType(other.getType()); - } - if (other.hasIsArray()) { - setIsArray(other.getIsArray()); - } - if (!other.intValue_.isEmpty()) { - if (result.intValue_.isEmpty()) { - result.intValue_ = new java.util.ArrayList<java.lang.Integer>(); - } - result.intValue_.addAll(other.intValue_); - } - if (!other.floatValue_.isEmpty()) { - if (result.floatValue_.isEmpty()) { - result.floatValue_ = new java.util.ArrayList<java.lang.Float>(); - } - result.floatValue_.addAll(other.floatValue_); - } - if (!other.charValue_.isEmpty()) { - if (result.charValue_.isEmpty()) { - result.charValue_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); - } - result.charValue_.addAll(other.charValue_); - } - if (!other.rawBytes_.isEmpty()) { - if (result.rawBytes_.isEmpty()) { - result.rawBytes_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); - } - result.rawBytes_.addAll(other.rawBytes_); - } - if (!other.boolValue_.isEmpty()) { - if (result.boolValue_.isEmpty()) { - result.boolValue_ = new java.util.ArrayList<java.lang.Boolean>(); - } - result.boolValue_.addAll(other.boolValue_); - } - return this; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - return this; - default: { - if (!parseUnknownField(input, extensionRegistry, tag)) { - return this; - } - break; - } - case 8: { - int rawValue = input.readEnum(); - com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.Type value = com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.Type.valueOf(rawValue); - if (value != null) { - setType(value); - } - break; - } - case 16: { - setIsArray(input.readBool()); - break; - } - case 24: { - addIntValue(input.readInt32()); - break; - } - case 26: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - while (input.getBytesUntilLimit() > 0) { - addIntValue(input.readInt32()); - } - input.popLimit(limit); - break; - } - case 37: { - addFloatValue(input.readFloat()); - break; - } - case 34: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - while (input.getBytesUntilLimit() > 0) { - addFloatValue(input.readFloat()); - } - input.popLimit(limit); - break; - } - case 42: { - addCharValue(input.readBytes()); - break; - } - case 50: { - addRawBytes(input.readBytes()); - break; - } - case 56: { - addBoolValue(input.readBool()); - break; - } - case 58: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - while (input.getBytesUntilLimit() > 0) { - addBoolValue(input.readBool()); - } - input.popLimit(limit); - break; - } - } - } - } - - - // required .com.android.gltrace.GLCall.DataType.Type type = 1 [default = VOID]; - public boolean hasType() { - return result.hasType(); - } - public com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.Type getType() { - return result.getType(); - } - public Builder setType(com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.Type value) { - if (value == null) { - throw new NullPointerException(); - } - result.hasType = true; - result.type_ = value; - return this; - } - public Builder clearType() { - result.hasType = false; - result.type_ = com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.Type.VOID; - return this; - } - - // required bool isArray = 2 [default = false]; - public boolean hasIsArray() { - return result.hasIsArray(); - } - public boolean getIsArray() { - return result.getIsArray(); - } - public Builder setIsArray(boolean value) { - result.hasIsArray = true; - result.isArray_ = value; - return this; - } - public Builder clearIsArray() { - result.hasIsArray = false; - result.isArray_ = false; - return this; - } - - // repeated int32 intValue = 3; - public java.util.List<java.lang.Integer> getIntValueList() { - return java.util.Collections.unmodifiableList(result.intValue_); - } - public int getIntValueCount() { - return result.getIntValueCount(); - } - public int getIntValue(int index) { - return result.getIntValue(index); - } - public Builder setIntValue(int index, int value) { - result.intValue_.set(index, value); - return this; - } - public Builder addIntValue(int value) { - if (result.intValue_.isEmpty()) { - result.intValue_ = new java.util.ArrayList<java.lang.Integer>(); - } - result.intValue_.add(value); - return this; - } - public Builder addAllIntValue( - java.lang.Iterable<? extends java.lang.Integer> values) { - if (result.intValue_.isEmpty()) { - result.intValue_ = new java.util.ArrayList<java.lang.Integer>(); - } - super.addAll(values, result.intValue_); - return this; - } - public Builder clearIntValue() { - result.intValue_ = java.util.Collections.emptyList(); - return this; - } - - // repeated float floatValue = 4; - public java.util.List<java.lang.Float> getFloatValueList() { - return java.util.Collections.unmodifiableList(result.floatValue_); - } - public int getFloatValueCount() { - return result.getFloatValueCount(); - } - public float getFloatValue(int index) { - return result.getFloatValue(index); - } - public Builder setFloatValue(int index, float value) { - result.floatValue_.set(index, value); - return this; - } - public Builder addFloatValue(float value) { - if (result.floatValue_.isEmpty()) { - result.floatValue_ = new java.util.ArrayList<java.lang.Float>(); - } - result.floatValue_.add(value); - return this; - } - public Builder addAllFloatValue( - java.lang.Iterable<? extends java.lang.Float> values) { - if (result.floatValue_.isEmpty()) { - result.floatValue_ = new java.util.ArrayList<java.lang.Float>(); - } - super.addAll(values, result.floatValue_); - return this; - } - public Builder clearFloatValue() { - result.floatValue_ = java.util.Collections.emptyList(); - return this; - } - - // repeated bytes charValue = 5; - public java.util.List<com.google.protobuf.ByteString> getCharValueList() { - return java.util.Collections.unmodifiableList(result.charValue_); - } - public int getCharValueCount() { - return result.getCharValueCount(); - } - public com.google.protobuf.ByteString getCharValue(int index) { - return result.getCharValue(index); - } - public Builder setCharValue(int index, com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - result.charValue_.set(index, value); - return this; - } - public Builder addCharValue(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - if (result.charValue_.isEmpty()) { - result.charValue_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); - } - result.charValue_.add(value); - return this; - } - public Builder addAllCharValue( - java.lang.Iterable<? extends com.google.protobuf.ByteString> values) { - if (result.charValue_.isEmpty()) { - result.charValue_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); - } - super.addAll(values, result.charValue_); - return this; - } - public Builder clearCharValue() { - result.charValue_ = java.util.Collections.emptyList(); - return this; - } - - // repeated bytes rawBytes = 6; - public java.util.List<com.google.protobuf.ByteString> getRawBytesList() { - return java.util.Collections.unmodifiableList(result.rawBytes_); - } - public int getRawBytesCount() { - return result.getRawBytesCount(); - } - public com.google.protobuf.ByteString getRawBytes(int index) { - return result.getRawBytes(index); - } - public Builder setRawBytes(int index, com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - result.rawBytes_.set(index, value); - return this; - } - public Builder addRawBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - if (result.rawBytes_.isEmpty()) { - result.rawBytes_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); - } - result.rawBytes_.add(value); - return this; - } - public Builder addAllRawBytes( - java.lang.Iterable<? extends com.google.protobuf.ByteString> values) { - if (result.rawBytes_.isEmpty()) { - result.rawBytes_ = new java.util.ArrayList<com.google.protobuf.ByteString>(); - } - super.addAll(values, result.rawBytes_); - return this; - } - public Builder clearRawBytes() { - result.rawBytes_ = java.util.Collections.emptyList(); - return this; - } - - // repeated bool boolValue = 7; - public java.util.List<java.lang.Boolean> getBoolValueList() { - return java.util.Collections.unmodifiableList(result.boolValue_); - } - public int getBoolValueCount() { - return result.getBoolValueCount(); - } - public boolean getBoolValue(int index) { - return result.getBoolValue(index); - } - public Builder setBoolValue(int index, boolean value) { - result.boolValue_.set(index, value); - return this; - } - public Builder addBoolValue(boolean value) { - if (result.boolValue_.isEmpty()) { - result.boolValue_ = new java.util.ArrayList<java.lang.Boolean>(); - } - result.boolValue_.add(value); - return this; - } - public Builder addAllBoolValue( - java.lang.Iterable<? extends java.lang.Boolean> values) { - if (result.boolValue_.isEmpty()) { - result.boolValue_ = new java.util.ArrayList<java.lang.Boolean>(); - } - super.addAll(values, result.boolValue_); - return this; - } - public Builder clearBoolValue() { - result.boolValue_ = java.util.Collections.emptyList(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.android.gltrace.GLCall.DataType) - } - - static { - defaultInstance = new DataType(true); - com.android.ide.eclipse.gltrace.Glcall.internalForceInit(); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.android.gltrace.GLCall.DataType) - } - - // required int32 context_id = 1; - public static final int CONTEXT_ID_FIELD_NUMBER = 1; - private boolean hasContextId; - private int contextId_ = 0; - public boolean hasContextId() { return hasContextId; } - public int getContextId() { return contextId_; } - - // required .com.android.gltrace.GLCall.Function function = 2 [default = invalid]; - public static final int FUNCTION_FIELD_NUMBER = 2; - private boolean hasFunction; - private com.android.ide.eclipse.gltrace.Glcall.GLCall.Function function_; - public boolean hasFunction() { return hasFunction; } - public com.android.ide.eclipse.gltrace.Glcall.GLCall.Function getFunction() { return function_; } - - // repeated .com.android.gltrace.GLCall.DataType args = 3; - public static final int ARGS_FIELD_NUMBER = 3; - private java.util.List<com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType> args_ = - java.util.Collections.emptyList(); - public java.util.List<com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType> getArgsList() { - return args_; - } - public int getArgsCount() { return args_.size(); } - public com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType getArgs(int index) { - return args_.get(index); - } - - // optional .com.android.gltrace.GLCall.DataType returnValue = 4; - public static final int RETURNVALUE_FIELD_NUMBER = 4; - private boolean hasReturnValue; - private com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType returnValue_; - public boolean hasReturnValue() { return hasReturnValue; } - public com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType getReturnValue() { return returnValue_; } - - // optional float duration = 5; - public static final int DURATION_FIELD_NUMBER = 5; - private boolean hasDuration; - private float duration_ = 0F; - public boolean hasDuration() { return hasDuration; } - public float getDuration() { return duration_; } - - private void initFields() { - function_ = com.android.ide.eclipse.gltrace.Glcall.GLCall.Function.invalid; - returnValue_ = com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.getDefaultInstance(); - } - public final boolean isInitialized() { - if (!hasContextId) return false; - if (!hasFunction) return false; - for (com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType element : getArgsList()) { - if (!element.isInitialized()) return false; - } - if (hasReturnValue()) { - if (!getReturnValue().isInitialized()) return false; - } - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (hasContextId()) { - output.writeInt32(1, getContextId()); - } - if (hasFunction()) { - output.writeEnum(2, getFunction().getNumber()); - } - for (com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType element : getArgsList()) { - output.writeMessage(3, element); - } - if (hasReturnValue()) { - output.writeMessage(4, getReturnValue()); - } - if (hasDuration()) { - output.writeFloat(5, getDuration()); - } - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasContextId()) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, getContextId()); - } - if (hasFunction()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, getFunction().getNumber()); - } - for (com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType element : getArgsList()) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, element); - } - if (hasReturnValue()) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getReturnValue()); - } - if (hasDuration()) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(5, getDuration()); - } - memoizedSerializedSize = size; - return size; - } - - public static com.android.ide.eclipse.gltrace.Glcall.GLCall parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static com.android.ide.eclipse.gltrace.Glcall.GLCall parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static com.android.ide.eclipse.gltrace.Glcall.GLCall parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static com.android.ide.eclipse.gltrace.Glcall.GLCall parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static com.android.ide.eclipse.gltrace.Glcall.GLCall parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static com.android.ide.eclipse.gltrace.Glcall.GLCall parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static com.android.ide.eclipse.gltrace.Glcall.GLCall parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static com.android.ide.eclipse.gltrace.Glcall.GLCall parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static com.android.ide.eclipse.gltrace.Glcall.GLCall parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static com.android.ide.eclipse.gltrace.Glcall.GLCall parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.android.ide.eclipse.gltrace.Glcall.GLCall prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - com.android.ide.eclipse.gltrace.Glcall.GLCall, Builder> { - private com.android.ide.eclipse.gltrace.Glcall.GLCall result; - - // Construct using com.android.gltrace.Glcall.GLCall.newBuilder() - private Builder() {} - - private static Builder create() { - Builder builder = new Builder(); - builder.result = new com.android.ide.eclipse.gltrace.Glcall.GLCall(); - return builder; - } - - @Override - protected com.android.ide.eclipse.gltrace.Glcall.GLCall internalGetResult() { - return result; - } - - public Builder clear() { - if (result == null) { - throw new IllegalStateException( - "Cannot call clear() after build()."); - } - result = new com.android.ide.eclipse.gltrace.Glcall.GLCall(); - return this; - } - - @Override - public Builder clone() { - return create().mergeFrom(result); - } - - @Override - public com.android.ide.eclipse.gltrace.Glcall.GLCall getDefaultInstanceForType() { - return com.android.ide.eclipse.gltrace.Glcall.GLCall.getDefaultInstance(); - } - - public boolean isInitialized() { - return result.isInitialized(); - } - public com.android.ide.eclipse.gltrace.Glcall.GLCall build() { - if (result != null && !isInitialized()) { - throw newUninitializedMessageException(result); - } - return buildPartial(); - } - - private com.android.ide.eclipse.gltrace.Glcall.GLCall buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return buildPartial(); - } - - public com.android.ide.eclipse.gltrace.Glcall.GLCall buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); - } - if (result.args_ != java.util.Collections.EMPTY_LIST) { - result.args_ = - java.util.Collections.unmodifiableList(result.args_); - } - com.android.ide.eclipse.gltrace.Glcall.GLCall returnMe = result; - result = null; - return returnMe; - } - - @Override - public Builder mergeFrom(com.android.ide.eclipse.gltrace.Glcall.GLCall other) { - if (other == com.android.ide.eclipse.gltrace.Glcall.GLCall.getDefaultInstance()) return this; - if (other.hasContextId()) { - setContextId(other.getContextId()); - } - if (other.hasFunction()) { - setFunction(other.getFunction()); - } - if (!other.args_.isEmpty()) { - if (result.args_.isEmpty()) { - result.args_ = new java.util.ArrayList<com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType>(); - } - result.args_.addAll(other.args_); - } - if (other.hasReturnValue()) { - mergeReturnValue(other.getReturnValue()); - } - if (other.hasDuration()) { - setDuration(other.getDuration()); - } - return this; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - return this; - default: { - if (!parseUnknownField(input, extensionRegistry, tag)) { - return this; - } - break; - } - case 8: { - setContextId(input.readInt32()); - break; - } - case 16: { - int rawValue = input.readEnum(); - com.android.ide.eclipse.gltrace.Glcall.GLCall.Function value = com.android.ide.eclipse.gltrace.Glcall.GLCall.Function.valueOf(rawValue); - if (value != null) { - setFunction(value); - } - break; - } - case 26: { - com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.Builder subBuilder = com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addArgs(subBuilder.buildPartial()); - break; - } - case 34: { - com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.Builder subBuilder = com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.newBuilder(); - if (hasReturnValue()) { - subBuilder.mergeFrom(getReturnValue()); - } - input.readMessage(subBuilder, extensionRegistry); - setReturnValue(subBuilder.buildPartial()); - break; - } - case 45: { - setDuration(input.readFloat()); - break; - } - } - } - } - - - // required int32 context_id = 1; - public boolean hasContextId() { - return result.hasContextId(); - } - public int getContextId() { - return result.getContextId(); - } - public Builder setContextId(int value) { - result.hasContextId = true; - result.contextId_ = value; - return this; - } - public Builder clearContextId() { - result.hasContextId = false; - result.contextId_ = 0; - return this; - } - - // required .com.android.gltrace.GLCall.Function function = 2 [default = invalid]; - public boolean hasFunction() { - return result.hasFunction(); - } - public com.android.ide.eclipse.gltrace.Glcall.GLCall.Function getFunction() { - return result.getFunction(); - } - public Builder setFunction(com.android.ide.eclipse.gltrace.Glcall.GLCall.Function value) { - if (value == null) { - throw new NullPointerException(); - } - result.hasFunction = true; - result.function_ = value; - return this; - } - public Builder clearFunction() { - result.hasFunction = false; - result.function_ = com.android.ide.eclipse.gltrace.Glcall.GLCall.Function.invalid; - return this; - } - - // repeated .com.android.gltrace.GLCall.DataType args = 3; - public java.util.List<com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType> getArgsList() { - return java.util.Collections.unmodifiableList(result.args_); - } - public int getArgsCount() { - return result.getArgsCount(); - } - public com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType getArgs(int index) { - return result.getArgs(index); - } - public Builder setArgs(int index, com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - result.args_.set(index, value); - return this; - } - public Builder setArgs(int index, com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.Builder builderForValue) { - result.args_.set(index, builderForValue.build()); - return this; - } - public Builder addArgs(com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - if (result.args_.isEmpty()) { - result.args_ = new java.util.ArrayList<com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType>(); - } - result.args_.add(value); - return this; - } - public Builder addArgs(com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.Builder builderForValue) { - if (result.args_.isEmpty()) { - result.args_ = new java.util.ArrayList<com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType>(); - } - result.args_.add(builderForValue.build()); - return this; - } - public Builder addAllArgs( - java.lang.Iterable<? extends com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType> values) { - if (result.args_.isEmpty()) { - result.args_ = new java.util.ArrayList<com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType>(); - } - super.addAll(values, result.args_); - return this; - } - public Builder clearArgs() { - result.args_ = java.util.Collections.emptyList(); - return this; - } - - // optional .com.android.gltrace.GLCall.DataType returnValue = 4; - public boolean hasReturnValue() { - return result.hasReturnValue(); - } - public com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType getReturnValue() { - return result.getReturnValue(); - } - public Builder setReturnValue(com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - result.hasReturnValue = true; - result.returnValue_ = value; - return this; - } - public Builder setReturnValue(com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.Builder builderForValue) { - result.hasReturnValue = true; - result.returnValue_ = builderForValue.build(); - return this; - } - public Builder mergeReturnValue(com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType value) { - if (result.hasReturnValue() && - result.returnValue_ != com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.getDefaultInstance()) { - result.returnValue_ = - com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.newBuilder(result.returnValue_).mergeFrom(value).buildPartial(); - } else { - result.returnValue_ = value; - } - result.hasReturnValue = true; - return this; - } - public Builder clearReturnValue() { - result.hasReturnValue = false; - result.returnValue_ = com.android.ide.eclipse.gltrace.Glcall.GLCall.DataType.getDefaultInstance(); - return this; - } - - // optional float duration = 5; - public boolean hasDuration() { - return result.hasDuration(); - } - public float getDuration() { - return result.getDuration(); - } - public Builder setDuration(float value) { - result.hasDuration = true; - result.duration_ = value; - return this; - } - public Builder clearDuration() { - result.hasDuration = false; - result.duration_ = 0F; - return this; - } - - // @@protoc_insertion_point(builder_scope:com.android.gltrace.GLCall) - } - - static { - defaultInstance = new GLCall(true); - com.android.ide.eclipse.gltrace.Glcall.internalForceInit(); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.android.gltrace.GLCall) - } - - - static { - } - - public static void internalForceInit() {} - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/ProtoBufUtils.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/ProtoBufUtils.java new file mode 100644 index 0000000..7165e63 --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/ProtoBufUtils.java @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 + * + * 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.gltrace; + +import com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage; + +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.ImageData; +import org.eclipse.swt.graphics.PaletteData; +import org.eclipse.swt.widgets.Display; +import org.liblzf.CLZF; + +/** Utilities to deal with protobuf encoded {@link GLMessage}. */ +public class ProtoBufUtils { + private static ImageData getImageData(GLMessage glMsg) { + int width = glMsg.getFb().getWidth(); + int height = glMsg.getFb().getHeight(); + + byte[] compressed = glMsg.getFb().getContents(0).toByteArray(); + byte[] uncompressed = new byte[width * height * 4]; + + int size = CLZF.lzf_decompress(compressed, compressed.length, + uncompressed, uncompressed.length); + assert size == width * height * 4 : "Unexpected image size after decompression."; + + int redMask = 0xff000000; + int greenMask = 0x00ff0000; + int blueMask = 0x0000ff00; + PaletteData palette = new PaletteData(redMask, greenMask, blueMask); + ImageData imageData = new ImageData( + width, + height, + 32, // depth + palette, + 1, // scan line padding + uncompressed); + imageData = imageData.scaledTo(imageData.width, -imageData.height); + + return imageData; + } + + /** Obtains the image stored in provided protocol buffer message. */ + public static Image getImage(Display display, GLMessage glMsg) { + if (!glMsg.hasFb()) { + return null; + } + + return new Image(display, getImageData(glMsg)); + } + + /** + * Obtains the image stored in provided protocol buffer message scaled to the + * provided dimensions. + */ + public static Image getScaledImage(Display display, GLMessage glMsg, int width, int height) { + if (!glMsg.hasFb()) { + return null; + } + + ImageData imageData = getImageData(glMsg); + return new Image(display, imageData.scaledTo(width, height)); + } +} diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLTrace.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/TraceFileInfo.java index bee494c..80933b0 100644 --- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLTrace.java +++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/TraceFileInfo.java @@ -16,22 +16,26 @@ package com.android.ide.eclipse.gltrace; -import java.util.ArrayList; -import java.util.List; +public class TraceFileInfo { + private final String mPath; + private final long mSize; + private final long mLastModified; -/** A GLTrace is an in memory model of the trace file. */ -public class GLTrace { - List<GLFrame> mGLFrames; + public TraceFileInfo(String path, long size, long lastModified) { + mPath = path; + mSize = size; + mLastModified = lastModified; + } - public GLTrace() { - mGLFrames = new ArrayList<GLFrame>(); + public String getPath() { + return mPath; } - public void addGLFrame(GLFrame frame) { - mGLFrames.add(frame); + public long getSize() { + return mSize; } - public List<GLFrame> getGLFrames() { - return mGLFrames; + public long getLastModificationTime() { + return mLastModified; } } diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/TraceFileParserTask.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/TraceFileParserTask.java new file mode 100644 index 0000000..fb93809 --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/TraceFileParserTask.java @@ -0,0 +1,152 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 + * + * 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.gltrace; + +import com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage; +import com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.Function; +import com.android.ide.eclipse.gltrace.model.GLCall; +import com.android.ide.eclipse.gltrace.model.GLFrame; +import com.android.ide.eclipse.gltrace.model.GLTrace; +import com.android.ide.eclipse.gltrace.state.GLStateTransform; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.List; + +public class TraceFileParserTask implements IRunnableWithProgress { + private static final TraceFileReader sReader = new TraceFileReader(); + + private final Display mDisplay; + private final int mThumbHeight; + private final int mThumbWidth; + + private String mTraceFilePath; + private RandomAccessFile mFile; + + private List<GLCall> mGLCalls; + private List<List<GLStateTransform>> mStateTransformsPerCall; + private List<GLFrame> mGLFrames; + + private int mFrameCount; + private int mCurrentFrameStartIndex, mCurrentFrameEndIndex; + private GLTrace mTrace; + + /** + * Construct a GL Trace file parser. + * @param path path to trace file + * @param thumbDisplay display to use to create thumbnail images + * @param thumbWidth width of thumbnail images + * @param thumbHeight height of thumbnail images + */ + public TraceFileParserTask(String path, Display thumbDisplay, int thumbWidth, + int thumbHeight) { + try { + mFile = new RandomAccessFile(path, "r"); //$NON-NLS-1$ + } catch (FileNotFoundException e) { + throw new IllegalArgumentException(e); + } + + mDisplay = thumbDisplay; + mThumbWidth = thumbWidth; + mThumbHeight = thumbHeight; + + mTraceFilePath = path; + mGLCalls = new ArrayList<GLCall>(); + mStateTransformsPerCall = new ArrayList<List<GLStateTransform>>(); + mFrameCount = 0; + mCurrentFrameStartIndex = 0; + mCurrentFrameEndIndex = 0; + mGLFrames = new ArrayList<GLFrame>(); + } + + private void addMessage(int index, long traceFileOffset, GLMessage msg) { + Image previewImage = null; + if (mDisplay != null) { + previewImage = ProtoBufUtils.getScaledImage(mDisplay, msg, mThumbWidth, mThumbHeight); + } + + GLCall c = new GLCall(index, traceFileOffset, msg, previewImage); + + mGLCalls.add(c); + mStateTransformsPerCall.add(GLStateTransform.getTransformsFor(c)); + mCurrentFrameEndIndex++; + + if (c.getFunction() == Function.eglSwapBuffers) { + mGLFrames.add(new GLFrame(mFrameCount, + mCurrentFrameStartIndex, + mCurrentFrameEndIndex)); + + mFrameCount++; + mCurrentFrameStartIndex = mCurrentFrameEndIndex; + } + } + + /** + * Parse the entire file and create a {@link GLTrace} object that can be retrieved + * using {@link #getTrace()}. + */ + public void run(IProgressMonitor monitor) throws InvocationTargetException, + InterruptedException { + monitor.beginTask("Parsing OpenGL Trace File", IProgressMonitor.UNKNOWN); + + try { + GLMessage msg = null; + int msgCount = 0; + long filePointer = mFile.getFilePointer(); + + while ((msg = sReader.getMessageAtOffset(mFile, 0)) != null) { + addMessage(msgCount, filePointer, msg); + + filePointer = mFile.getFilePointer(); + msgCount++; + + if (monitor.isCanceled()) { + throw new InterruptedException(); + } + } + } catch (Exception e) { + throw new InvocationTargetException(e); + } finally { + try { + mFile.close(); + } catch (IOException e) { + // ignore exception while closing file + } + monitor.done(); + } + + File f = new File(mTraceFilePath); + TraceFileInfo fileInfo = new TraceFileInfo(mTraceFilePath, f.length(), f.lastModified()); + mTrace = new GLTrace(fileInfo, mGLFrames, mGLCalls, mStateTransformsPerCall); + } + + /** + * Retrieve the trace object constructed from messages in the trace file. + */ + public GLTrace getTrace() { + return mTrace; + } +} diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/TraceFileReader.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/TraceFileReader.java new file mode 100644 index 0000000..e5121bf --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/TraceFileReader.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 + * + * 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.gltrace; + +import com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage; +import com.google.protobuf.InvalidProtocolBufferException; + +import java.io.EOFException; +import java.io.IOException; +import java.io.RandomAccessFile; + +public class TraceFileReader { + /** Maximum size for a protocol buffer message. + * The message size is dominated by the size of the compressed framebuffer. + * Currently, we assume that the maximum is for a 1080p display. Since the buffers compress + * well, we should probably never get close to this. + */ + private static final int MAX_PROTOBUF_SIZE = 1920 * 1080 * 4; + + /** + * Obtain the next protobuf message in this file. + * @param file file to read from + * @param offset offset to start reading from + * @return protobuf message at given offset + * @throws IOException in case of file I/O errors + * @throws InvalidProtocolBufferException if protobuf is not well formed + */ + public GLMessage getMessageAtOffset(RandomAccessFile file, long offset) throws IOException { + int len; + byte[] b; + try { + if (offset != 0) { + file.seek(offset); + } + + len = file.readInt(); + if (len > MAX_PROTOBUF_SIZE) { + String msg = String.format( + "Unexpectedly large (%d bytes) protocol buffer message encountered.", + len); + throw new InvalidProtocolBufferException(msg); + } + + b = new byte[len]; + file.readFully(b); + } catch (EOFException e) { + return null; + } + + return GLMessage.parseFrom(b); + } +} diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/editors/GLFunctionTraceViewer.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/editors/GLFunctionTraceViewer.java index e936f5a..b357220 100644 --- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/editors/GLFunctionTraceViewer.java +++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/editors/GLFunctionTraceViewer.java @@ -17,14 +17,14 @@ package com.android.ide.eclipse.gltrace.editors; import com.android.ide.eclipse.gltrace.GLCallFormatter; -import com.android.ide.eclipse.gltrace.GLFrame; -import com.android.ide.eclipse.gltrace.GLTrace; -import com.android.ide.eclipse.gltrace.GLTraceReader; -import com.android.ide.eclipse.gltrace.Glcall.GLCall; -import com.android.ide.eclipse.gltrace.state.IGLProperty; +import com.android.ide.eclipse.gltrace.TraceFileParserTask; +import com.android.ide.eclipse.gltrace.model.GLCall; +import com.android.ide.eclipse.gltrace.model.GLTrace; import com.android.ide.eclipse.gltrace.views.GLFramebufferView; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.viewers.ColumnLabelProvider; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; @@ -58,9 +58,9 @@ import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.part.EditorPart; +import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; -import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -70,6 +70,15 @@ public class GLFunctionTraceViewer extends EditorPart implements ISelectionProvi private static final String GL_SPECS_FILE = "/entries.in"; //$NON-NLS-1$ private static final String DEFAULT_FILTER_MESSAGE = "Filter list of OpenGL calls. Accepts Java regexes."; + + // TODO: The thumbnail width & height are constant right now, but should be scaled + // based on the size of the viewport/device. + /** Width of thumbnail images of the framebuffer. */ + private static final int THUMBNAIL_WIDTH = 50; + + /** Height of thumbnail images of the framebuffer. */ + private static final int THUMBNAIL_HEIGHT = 50; + private final GLCallFormatter mGLCallFormatter = new GLCallFormatter(getClass().getResourceAsStream(GL_SPECS_FILE)); @@ -78,7 +87,6 @@ public class GLFunctionTraceViewer extends EditorPart implements ISelectionProvi private Spinner mFrameSelectionSpinner; private GLTrace mTrace; - private GLFrame mSelectedFrame; private TableViewer mFrameTableViewer; private Text mFilterText; private GLCallFilter mGLCallFilter; @@ -127,12 +135,25 @@ public class GLFunctionTraceViewer extends EditorPart implements ISelectionProvi createFilterBar(c); createFrameTraceView(c); - // this should be done in a separate thread - GLTraceReader reader = new GLTraceReader(mFilePath); - mTrace = reader.parseTrace(); - getSite().setSelectionProvider(mFrameTableViewer); + ProgressMonitorDialog dlg = new ProgressMonitorDialog(parent.getShell()); + TraceFileParserTask parser = new TraceFileParserTask(mFilePath, parent.getDisplay(), + THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT); + try { + dlg.run(true, true, parser); + } catch (InvocationTargetException e) { + // exception while parsing, display error to user + MessageDialog.openError(parent.getShell(), + "Error parsing OpenGL Trace File", + e.getCause().getMessage()); + return; + } catch (InterruptedException e) { + // operation canceled by user, just return + return; + } + + mTrace = parser.getTrace(); refreshUI(); } @@ -140,7 +161,7 @@ public class GLFunctionTraceViewer extends EditorPart implements ISelectionProvi int nFrames = 0; if (mTrace != null) { - nFrames = mTrace.getGLFrames().size(); + nFrames = mTrace.getFrames().size(); } setFrameCount(nFrames); @@ -195,8 +216,8 @@ public class GLFunctionTraceViewer extends EditorPart implements ISelectionProvi mFrameSelectionScale.setSelection(selectedFrame); mFrameSelectionSpinner.setSelection(selectedFrame); - mSelectedFrame = mTrace.getGLFrames().get(selectedFrame - 1); - mFrameTableViewer.setInput(mSelectedFrame); + List<GLCall> glcalls = mTrace.getGLCallsForFrame(selectedFrame - 1); + mFrameTableViewer.setInput(glcalls); } private void createFilterBar(Composite parent) { @@ -274,7 +295,7 @@ public class GLFunctionTraceViewer extends EditorPart implements ISelectionProvi return; } - v.displayFB(glCall); + v.displayFB(mTrace.getImage(glCall)); } private GLFramebufferView displayFBView(IWorkbenchPage page) { @@ -304,8 +325,8 @@ public class GLFunctionTraceViewer extends EditorPart implements ISelectionProvi } public Object[] getElements(Object model) { - if (model instanceof GLFrame) { - return ((GLFrame) model).getGLCalls().toArray(); + if (model instanceof List<?>) { + return ((List<?>) model).toArray(); } return null; @@ -393,19 +414,7 @@ public class GLFunctionTraceViewer extends EditorPart implements ISelectionProvi } } - public IGLProperty getStateAt(GLCall call) { - if (mSelectedFrame == null) { - return null; - } - - return mSelectedFrame.getStateAt(call); - } - - public Set<IGLProperty> getChangedProperties(GLCall from, GLCall to, IGLProperty state) { - if (mSelectedFrame == null) { - return null; - } - - return mSelectedFrame.getChangedProperties(from, to, state); + public GLTrace getTrace() { + return mTrace; } } diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/model/GLCall.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/model/GLCall.java new file mode 100644 index 0000000..c090ddf --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/model/GLCall.java @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 + * + * 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.gltrace.model; + +import com.android.ide.eclipse.gltrace.GLProtoBuf; +import com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage; +import com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.DataType; +import com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage.Function; + +import org.eclipse.swt.graphics.Image; + +import java.util.List; + +/** + * A GLCall is the in memory representation of a single {@link GLProtoBuf.GLMessage}. + * + * Some protocol buffer messages have a large amount of image data packed in them. Rather + * than storing all of that in memory, the GLCall stores a thumbnail image, and an offset + * into the trace file corresponding to original protocol buffer message. If full image data + * is required, the protocol buffer message can be recreated by reading the trace at the + * specified offset. + */ +public class GLCall { + /** Index of this call in the trace. */ + private final int mIndex; + + /** Offset of the protobuf message corresponding to this call in the trace file. */ + private final long mTraceFileOffset; + + /** Corresponding protobuf message with its image data stripped. */ + private final GLMessage mMessage; + + /** Flag indicating whether the original protobuf message included FB data. */ + private final boolean mHasFb; + + /** Thumbnail image of the framebuffer if available. */ + private final Image mThumbnailImage; + + public GLCall(int index, long traceFileOffset, GLMessage msg, Image thumbnailImage) { + mIndex = index; + mTraceFileOffset = traceFileOffset; + + if (msg.hasFb()) { + // strip off the FB contents + msg = msg.toBuilder().clearFb().build(); + mHasFb = true; + } else { + mHasFb = false; + } + + mMessage = msg; + mThumbnailImage = thumbnailImage; + } + + public int getIndex() { + return mIndex; + } + + public long getOffsetInTraceFile() { + return mTraceFileOffset; + } + + public Function getFunction() { + return mMessage.getFunction(); + } + + public List<DataType> getArgsList() { + return mMessage.getArgsList(); + } + + public DataType getArg(int index) { + return mMessage.getArgs(index); + } + + public boolean hasFb() { + return mHasFb; + } + + public Image getThumbnailImage() { + return mThumbnailImage; + } +} diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/model/GLFrame.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/model/GLFrame.java new file mode 100644 index 0000000..646d69b --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/model/GLFrame.java @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 + * + * 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.gltrace.model; + +/** + * A GLFrame is used to keep track of the start and end {@link GLCall} indices + * for each OpenGL frame. + */ +public class GLFrame { + private final int mIndex; + private final int mStartCallIndex; + private final int mEndCallIndex; + + public GLFrame(int frameIndex, int startCallIndex, int endCallIndex) { + mIndex = frameIndex; + mStartCallIndex = startCallIndex; + mEndCallIndex = endCallIndex; + } + + public int getIndex() { + return mIndex; + } + + public int getStartIndex() { + return mStartCallIndex; + } + + public int getEndIndex() { + return mEndCallIndex; + } +} diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLFrame.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/model/GLTrace.java index aa3c312..b5d20f8 100644 --- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLFrame.java +++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/model/GLTrace.java @@ -14,49 +14,81 @@ * limitations under the License. */ -package com.android.ide.eclipse.gltrace; +package com.android.ide.eclipse.gltrace.model; -import com.android.ide.eclipse.gltrace.Glcall.GLCall; +import com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage; +import com.android.ide.eclipse.gltrace.ProtoBufUtils; +import com.android.ide.eclipse.gltrace.TraceFileInfo; +import com.android.ide.eclipse.gltrace.TraceFileReader; import com.android.ide.eclipse.gltrace.state.GLState; import com.android.ide.eclipse.gltrace.state.GLStateTransform; import com.android.ide.eclipse.gltrace.state.IGLProperty; -import java.util.ArrayList; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; -/** A GLFrame is composed of a set of GL API Calls, ending with eglSwapBuffer. */ -public class GLFrame { - private List<GLCall> mGLCalls; +/** GLTrace is the in memory model of a OpenGL trace file. */ +public class GLTrace { + private static final TraceFileReader sTraceFileReader = new TraceFileReader(); + + /** Information regarding the trace file. */ + private final TraceFileInfo mTraceFileInfo; + + /** List of frames in the trace. */ + private final List<GLFrame> mGLFrames; + + /** List of GL Calls comprising the trace. */ + private final List<GLCall> mGLCalls; /** List of state transforms to be applied for each GLCall */ - private List<List<GLStateTransform>> mStateTransformsPerCall; + private final List<List<GLStateTransform>> mStateTransformsPerCall; /** OpenGL State as of call {@link #mCurrentStateIndex}. */ private IGLProperty mState; private int mCurrentStateIndex; - public GLFrame() { - mGLCalls = new ArrayList<GLCall>(); - mStateTransformsPerCall = new ArrayList<List<GLStateTransform>>(); + public GLTrace(TraceFileInfo traceFileInfo, List<GLFrame> glFrames, List<GLCall> glCalls, + List<List<GLStateTransform>> stateTransformsPerCall) { + mTraceFileInfo = traceFileInfo; + mGLFrames = glFrames; + mGLCalls = glCalls; + mStateTransformsPerCall = stateTransformsPerCall; mState = GLState.createDefaultState(); mCurrentStateIndex = -1; } - public void addGLCall(GLCall c) { - mGLCalls.add(c); - mStateTransformsPerCall.add(GLStateTransform.getTransformFor(c)); + public List<GLFrame> getFrames() { + return mGLFrames; } - public List<GLCall> getGLCalls() { - return mGLCalls; + public List<GLCall> getGLCallsForFrame(int frameIndex) { + if (frameIndex >= mGLFrames.size()) { + return Collections.emptyList(); + } + + GLFrame frame = mGLFrames.get(frameIndex); + int start = frame.getStartIndex(); + int end = frame.getEndIndex(); + + return mGLCalls.subList(start, end); } public IGLProperty getStateAt(GLCall call) { - int callIndex = mGLCalls.indexOf(call); + if (call == null) { + return null; + } + int callIndex = call.getIndex(); if (callIndex == mCurrentStateIndex) { return mState; } @@ -64,7 +96,6 @@ public class GLFrame { if (callIndex > mCurrentStateIndex) { // if the state is needed for a future GLCall, then apply the transformations // for all the GLCall's upto and including the required GLCall - for (int i = mCurrentStateIndex + 1; i <= callIndex; i++) { for (GLStateTransform f : mStateTransformsPerCall.get(i)) { f.apply(mState); @@ -92,8 +123,8 @@ public class GLFrame { * changing state from one GL call to another. */ public Set<IGLProperty> getChangedProperties(GLCall from, GLCall to, IGLProperty state) { - int fromIndex = mGLCalls.indexOf(from); - int toIndex = mGLCalls.indexOf(to); + int fromIndex = from == null ? 0 : from.getIndex(); + int toIndex = to == null ? 0 : to.getIndex(); if (fromIndex == -1 || toIndex == -1) { return null; @@ -119,4 +150,42 @@ public class GLFrame { return changedProperties; } + + public Image getImage(GLCall c) { + if (!c.hasFb()) { + return null; + } + + if (isTraceFileModified()) { + return c.getThumbnailImage(); + } + + RandomAccessFile file; + try { + file = new RandomAccessFile(mTraceFileInfo.getPath(), "r"); //$NON-NLS-1$ + } catch (FileNotFoundException e1) { + return c.getThumbnailImage(); + } + + GLMessage m = null; + try { + m = sTraceFileReader.getMessageAtOffset(file, c.getOffsetInTraceFile()); + } catch (Exception e) { + return null; + } finally { + try { + file.close(); + } catch (IOException e) { + // ignore exception while closing file + } + } + + return ProtoBufUtils.getImage(Display.getCurrent(), m); + } + + private boolean isTraceFileModified() { + File f = new File(mTraceFileInfo.getPath()); + return f.length() != mTraceFileInfo.getSize() + || f.lastModified() != mTraceFileInfo.getLastModificationTime(); + } } diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLStateTransform.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLStateTransform.java index 904bb7b..bda6dd7 100644 --- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLStateTransform.java +++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLStateTransform.java @@ -17,7 +17,7 @@ package com.android.ide.eclipse.gltrace.state; import com.android.ide.eclipse.gldebugger.GLEnum; -import com.android.ide.eclipse.gltrace.Glcall.GLCall; +import com.android.ide.eclipse.gltrace.model.GLCall; import java.util.ArrayList; import java.util.List; @@ -70,7 +70,7 @@ public class GLStateTransform { } /** Construct a list of transformations to be applied for the provided OpenGL call. */ - public static List<GLStateTransform> getTransformFor(GLCall call) { + public static List<GLStateTransform> getTransformsFor(GLCall call) { // TODO: currently we only modify state for glVertexAttribPointer() call. // Obviously, this will grow to be a long list. switch (call.getFunction()) { @@ -82,13 +82,13 @@ public class GLStateTransform { } private static List<GLStateTransform> transformsForGlVertexAttribPointer(GLCall call) { - int index = call.getArgs(0).getIntValue(0); + int index = call.getArg(0).getIntValue(0); - int size = call.getArgs(1).getIntValue(0); - int type = call.getArgs(2).getIntValue(0); - boolean normalized = call.getArgs(3).getBoolValue(0); - int stride = call.getArgs(4).getIntValue(0); - int pointer = call.getArgs(5).getIntValue(0); + int size = call.getArg(1).getIntValue(0); + int type = call.getArg(2).getIntValue(0); + boolean normalized = call.getArg(3).getBoolValue(0); + int stride = call.getArg(4).getIntValue(0); + int pointer = call.getArg(5).getIntValue(0); List<GLStateTransform> transforms = new ArrayList<GLStateTransform>(); transforms.add(new GLStateTransform( diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/views/GLFramebufferView.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/views/GLFramebufferView.java index e2bb68d..1d4be41 100644 --- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/views/GLFramebufferView.java +++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/views/GLFramebufferView.java @@ -16,15 +16,14 @@ package com.android.ide.eclipse.gltrace.views; -import com.android.ide.eclipse.gltrace.Glcall.GLCall; import com.android.ide.eclipse.gltrace.editors.GLFunctionTraceViewer; +import com.android.ide.eclipse.gltrace.model.GLCall; +import com.android.ide.eclipse.gltrace.model.GLTrace; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.PaletteData; import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; @@ -32,7 +31,6 @@ import org.eclipse.ui.ISelectionListener; import org.eclipse.ui.ISelectionService; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.part.ViewPart; -import org.liblzf.CLZF; import java.util.List; @@ -63,68 +61,19 @@ public class GLFramebufferView extends ViewPart implements ISelectionListener { public void setFocus() { } - public void displayFB(final GLCall glCall) { - final int imageArg; - - switch (glCall.getFunction()) { - case eglSwapBuffers: - imageArg = 0; - break; - case glDrawArrays: - imageArg = 3; - break; - case glDrawElements: - imageArg = 4; - break; - default: - return; - } - + public void displayFB(final Image image) { Display.getDefault().asyncExec(new Runnable() { public void run() { if (mImage != null) { mImage.dispose(); } - mImage = getImage(glCall, imageArg); + mImage = image; mCanvas.setBackgroundImage(mImage); } }); } - /** - * Obtain the image stored in provided GL Method call - * @param glCall glCall with image data - * @param imageArg argument that contains the image - * @return - */ - private Image getImage(GLCall glCall, int imageArg) { - int width = glCall.getArgs(imageArg).getIntValue(0); - int height = glCall.getArgs(imageArg).getIntValue(1); - - byte []compressed = glCall.getArgs(imageArg).getRawBytesList().get(0).toByteArray(); - byte []uncompressed = new byte[width * height * 4]; - - int size = CLZF.lzf_decompress(compressed, compressed.length, - uncompressed, uncompressed.length); - assert size == width * height * 4 : "Unexpected image size after decompression."; - - int redMask = 0xff000000; - int greenMask = 0x00ff0000; - int blueMask = 0x0000ff00; - PaletteData palette = new PaletteData(redMask, greenMask, blueMask); - ImageData imageData = new ImageData( - width, - height, - 32, // depth - palette, - 1, - uncompressed); - imageData = imageData.scaledTo(imageData.width, -imageData.height); - - return new Image(Display.getCurrent(), imageData); - } - public void selectionChanged(IWorkbenchPart part, ISelection selection) { if (!(part instanceof GLFunctionTraceViewer)) { return; @@ -140,7 +89,14 @@ public class GLFramebufferView extends ViewPart implements ISelectionListener { if (objects.size() > 0) { Object data = objects.get(0); if (data instanceof GLCall) { - displayFB((GLCall) data); + GLCall glCall = (GLCall) data; + if (!glCall.hasFb()) { + return; + } + + GLFunctionTraceViewer traceViewer = (GLFunctionTraceViewer) part; + GLTrace glTrace = traceViewer.getTrace(); + displayFB(glTrace.getImage(glCall)); } } } diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/views/GLStateView.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/views/GLStateView.java index 56edc91..b14a5d9 100644 --- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/views/GLStateView.java +++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/views/GLStateView.java @@ -16,8 +16,9 @@ package com.android.ide.eclipse.gltrace.views; -import com.android.ide.eclipse.gltrace.Glcall.GLCall; import com.android.ide.eclipse.gltrace.editors.GLFunctionTraceViewer; +import com.android.ide.eclipse.gltrace.model.GLCall; +import com.android.ide.eclipse.gltrace.model.GLTrace; import com.android.ide.eclipse.gltrace.state.IGLProperty; import org.eclipse.jface.viewers.ISelection; @@ -120,8 +121,13 @@ public class GLStateView extends ViewPart implements ISelectionListener { } } + GLTrace trace = traceViewer.getTrace(); + if (trace == null) { + return; + } + if (selectedCall != mCurrentGLCall) { - IGLProperty nextState = traceViewer.getStateAt(selectedCall); + IGLProperty nextState = trace.getStateAt(selectedCall); if (nextState != mState) { mState = nextState; mStateChanged = true; @@ -129,10 +135,11 @@ public class GLStateView extends ViewPart implements ISelectionListener { mStateChanged = false; } - mChangedProperties = traceViewer.getChangedProperties(mCurrentGLCall, selectedCall, + mChangedProperties = trace.getChangedProperties(mCurrentGLCall, selectedCall, mState); refreshUI(); + mCurrentGLCall = selectedCall; } } |