예제 #1
0
static void SetStaticGLContext(GLContext* context)
{
    if (!sGLContext.initialized()) {
      mozilla::DebugOnly<bool> success = sGLContext.init();
      MOZ_ASSERT(success);
    }

    sGLContext.set(context);
}
예제 #2
0
void
NS_SetMainThread()
{
    if (!sTLSIsMainThread.initialized()) {
        if (!sTLSIsMainThread.init()) {
            MOZ_CRASH();
        }
        sTLSIsMainThread.set(true);
    }
    MOZ_ASSERT(NS_IsMainThread());
}
예제 #3
0
void
InitScriptSettings()
{
  if (!sScriptSettingsTLS.initialized()) {
    bool success = sScriptSettingsTLS.init();
    if (!success) {
      MOZ_CRASH();
    }
  }

  sScriptSettingsTLS.set(nullptr);
}
예제 #4
0
void EnsureGLContext(const GrGLInterface* i)
{
    const DrawTarget* drawTarget = reinterpret_cast<const DrawTarget*>(i->fCallbackData);
    GLContext* gl = static_cast<GLContext*>(drawTarget->GetGLContext());
    gl->MakeCurrent();

    if (!sGLContext.initialized()) {
      mozilla::DebugOnly<bool> success = sGLContext.init();
      MOZ_ASSERT(success);
    }
    sGLContext.set(gl);
}
예제 #5
0
void EnsureGLContext(const GrGLInterface* i)
{
    const SkiaGLGlue* contextSkia = reinterpret_cast<const SkiaGLGlue*>(i->fCallbackData);
    GLContext* gl = contextSkia->GetGLContext();
    gl->MakeCurrent();

    if (!sGLContext.initialized()) {
      mozilla::DebugOnly<bool> success = sGLContext.init();
      MOZ_ASSERT(success);
    }
    sGLContext.set(gl);
}
예제 #6
0
void
InitScriptSettings()
{
  if (!sScriptSettingsTLS.initialized()) {
    bool success = sScriptSettingsTLS.init();
    if (!success) {
      MOZ_CRASH();
    }
  }

  ScriptSettingsStack* ptr = new ScriptSettingsStack();
  sScriptSettingsTLS.set(ptr);
}
예제 #7
0
void
InitTaskTracer(uint32_t aFlags)
{
  if (aFlags & FORKED_AFTER_NUWA) {
    ObsoleteCurrentTraceInfos();
    return;
  }

  MOZ_ASSERT(!sTraceInfos);
  sTraceInfos = new nsTArray<nsAutoPtr<TraceInfo>>();

  if (!sTraceInfoTLS.initialized()) {
    Unused << sTraceInfoTLS.init();
  }
}
예제 #8
0
TraceInfo*
GetOrCreateTraceInfo()
{
  ENSURE_TRUE(sTraceInfoTLS.initialized(), nullptr);
  ENSURE_TRUE(IsStartLogging(), nullptr);

  TraceInfo* info = sTraceInfoTLS.get();
  if (info && info->mObsolete) {
    // TraceInfo is obsolete: remove it.
    FreeTraceInfo(info);
    info = nullptr;
  }

  if (!info) {
    info = AllocTraceInfo(gettid());
    sTraceInfoTLS.set(info);
  }

  return info;
}
예제 #9
0
bool
ScriptSettingsInitialized()
{
  return sScriptSettingsTLS.initialized();
}