コード例 #1
0
NS_IMETHODIMP nsAbBSDirectory::GetChildNodes(nsISimpleEnumerator* *aResult)
{
  nsresult rv = EnsureInitialized();
  NS_ENSURE_SUCCESS(rv, rv);

  return NS_NewArrayEnumerator(aResult, mSubDirectories);
}
コード例 #2
0
TemporaryRef<SharedThreadPool>
SharedThreadPool::Get(const nsCString& aName, uint32_t aThreadLimit)
{
  MOZ_ASSERT(NS_IsMainThread());
  EnsureInitialized();
  MOZ_ASSERT(sMonitor);
  ReentrantMonitorAutoEnter mon(*sMonitor);
  SharedThreadPool* pool = nullptr;
  nsresult rv;
  if (!sPools->Get(aName, &pool)) {
    nsCOMPtr<nsIThreadPool> threadPool(CreateThreadPool(aName));
    NS_ENSURE_TRUE(threadPool, nullptr);
    pool = new SharedThreadPool(aName, threadPool);

    // Set the thread and idle limits. Note that we don't rely on the
    // EnsureThreadLimitIsAtLeast() call below, as the default thread limit
    // is 4, and if aThreadLimit is less than 4 we'll end up with a pool
    // with 4 threads rather than what we expected; so we'll have unexpected
    // behaviour.
    rv = pool->SetThreadLimit(aThreadLimit);
    NS_ENSURE_SUCCESS(rv, nullptr);

    rv = pool->SetIdleThreadLimit(aThreadLimit);
    NS_ENSURE_SUCCESS(rv, nullptr);

    sPools->Put(aName, pool);
  } else if (NS_FAILED(pool->EnsureThreadLimitIsAtLeast(aThreadLimit))) {
    NS_WARNING("Failed to set limits on thread pool");
  }

  MOZ_ASSERT(pool);
  RefPtr<SharedThreadPool> instance(pool);
  return instance.forget();
}
コード例 #3
0
HRESULT Service_Monitor::GetServiceHandle(LPCTSTR pServiceName, SC_HANDLE* pHandle)
{
    HRESULT hr = S_OK;

    if (pServiceName == NULL)
    {
        _tprintf(L"\nERROR: Null parameter for GetServiceHandle()\n");
        hr = HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER);
        goto Finished;
    }

    hr = EnsureInitialized();
    if (SUCCEEDED(hr))
    {
        *pHandle = OpenService(_hSCManager, pServiceName, SERVICE_START | SERVICE_STOP | SERVICE_QUERY_STATUS);
        if (*pHandle == NULL)
        {
            hr = HRESULT_FROM_WIN32(GetLastError());
            goto Finished;
        }
    }

Finished:
    return hr;
}
コード例 #4
0
ファイル: GfxInfo.cpp プロジェクト: MichaelKohler/gecko-dev
NS_IMETHODIMP
GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
{
  EnsureInitialized();
  aAdapterDriverDate.Truncate();
  return NS_OK;
}
コード例 #5
0
ファイル: GfxInfo.cpp プロジェクト: MichaelKohler/gecko-dev
NS_IMETHODIMP
GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
{
  EnsureInitialized();
  aAdapterRAM.Truncate();
  return NS_OK;
}
コード例 #6
0
NS_IMETHODIMP
nsCookiePermission::CanAccess(nsIURI         *aURI,
                              nsIChannel     *aChannel,
                              nsCookieAccess *aResult)
{
  // Check this protocol doesn't allow cookies
  bool hasFlags;
  nsresult rv =
    NS_URIChainHasFlags(aURI, nsIProtocolHandler::URI_FORBIDS_COOKIE_ACCESS,
                        &hasFlags);
  if (NS_FAILED(rv) || hasFlags) {
    *aResult = ACCESS_DENY;
    return NS_OK;
  }

  // Lazily initialize ourselves
  if (!EnsureInitialized())
    return NS_ERROR_UNEXPECTED;

  // finally, check with permission manager...
  rv = mPermMgr->TestPermission(aURI, kPermissionType, (uint32_t *) aResult);
  if (NS_SUCCEEDED(rv)) {
    if (*aResult == nsICookiePermission::ACCESS_SESSION) {
      *aResult = nsICookiePermission::ACCESS_ALLOW;
    }
  }

  return rv;
}
コード例 #7
0
ファイル: GfxInfo.cpp プロジェクト: MichaelKohler/gecko-dev
NS_IMETHODIMP
GfxInfo::GetAdapterDeviceID(nsAString & aAdapterDeviceID)
{
  EnsureInitialized();
  aAdapterDeviceID = NS_ConvertASCIItoUTF16(mGLStrings->Renderer());
  return NS_OK;
}
コード例 #8
0
ファイル: device.cpp プロジェクト: Inner-room/libdshowcapture
Result HDevice::Start()
{
	HRESULT hr;

	if (!EnsureInitialized(L"Start") ||
	    !EnsureInactive(L"Start"))
		return Result::Error;

	if (!!rocketEncoder)
		Sleep(ROCKET_WAIT_TIME_MS);

	hr = control->Run();

	if (FAILED(hr)) {
		if (hr == (HRESULT)0x8007001F) {
			WarningHR(L"Run failed, device already in use", hr);
			return Result::InUse;
		} else {
			WarningHR(L"Run failed", hr);
			return Result::Error;
		}
	}

	active = true;
	return Result::Success;
}
コード例 #9
0
ファイル: GfxInfo.cpp プロジェクト: MichaelKohler/gecko-dev
NS_IMETHODIMP
GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
{
  EnsureInitialized();
  aAdapterDriverVersion = NS_ConvertASCIItoUTF16(mGLStrings->Version());
  return NS_OK;
}
コード例 #10
0
ファイル: device.cpp プロジェクト: Inner-room/libdshowcapture
bool HDevice::SetAudioConfig(AudioConfig *config)
{
	ComPtr<IBaseFilter> filter;

	if (!EnsureInitialized(L"SetAudioConfig") ||
	    !EnsureInactive(L"SetAudioConfig"))
		return false;

	if (!audioConfig.useVideoDevice)
		graph->RemoveFilter(audioFilter);
	graph->RemoveFilter(audioCapture);
	graph->RemoveFilter(audioOutput);
	audioFilter.Release();
	audioCapture.Release();
	audioOutput.Release();
	audioMediaType = NULL;

	if (!config)
		return true;

	if (!config->useVideoDevice &&
	    config->name.empty() && config->path.empty()) {
		Error(L"No audio device name or path specified");
		return false;
	}

	if (config->useVideoDevice) {
		if (videoFilter == NULL) {
			Error(L"Tried to use video device's built-in audio, "
			      L"but no video device is present");
			return false;
		}

		filter = videoFilter;
	} else {
		bool success = GetDeviceFilter(CLSID_AudioInputDeviceCategory,
				config->name.c_str(), config->path.c_str(),
				&filter);
		if (!success) {
			Error(L"Audio device '%s': %s not found", config->name.c_str(),
					config->path.c_str());
			return false;
		}
	}

	if (filter == NULL)
		return false;

	audioConfig = *config;

	if (config->mode == AudioMode::Capture) {
		if (!SetupAudioCapture(filter, audioConfig))
			return false;

		*config = audioConfig;
		return true;
	}

	return SetupAudioOutput(filter, audioConfig);
}
コード例 #11
0
int
AndroidGraphicBuffer::Lock(uint32_t aUsage, unsigned char **bits)
{
  if (!EnsureInitialized())
    return true;

  return sGLFunctions.fGraphicBufferLock(mHandle, GetAndroidUsage(aUsage), bits);
}
コード例 #12
0
int
AndroidGraphicBuffer::Unlock()
{
  if (!EnsureInitialized())
    return false;

  return sGLFunctions.fGraphicBufferUnlock(mHandle);
}
コード例 #13
0
NS_IMETHODIMP nsAbBSDirectory::HasDirectory(nsIAbDirectory *dir, PRBool *hasDir)
{
  if (!hasDir)
    return NS_ERROR_NULL_POINTER;

  nsresult rv = EnsureInitialized();
  NS_ENSURE_SUCCESS(rv, rv);

  DIR_Server *dirServer = nsnull;
  mServers.Get(dir, &dirServer);
  return DIR_ContainsServer(dirServer, hasDir);
}
コード例 #14
0
NS_IMETHODIMP
nsIEHistoryEnumerator::HasMoreElements(bool* _retval)
{
  *_retval = false;

  EnsureInitialized();
  MOZ_ASSERT(mURLEnumerator, "Should have instanced an IE History URLEnumerator");
  if (!mURLEnumerator)
    return NS_OK;

  STATURL statURL;
  ULONG fetched;

  // First argument is not implemented, so doesn't matter what we pass.
  HRESULT hr = mURLEnumerator->Next(1, &statURL, &fetched);
  if (FAILED(hr) || fetched != 1UL) {
    // Reached the last entry.
    return NS_OK;
  }

  nsCOMPtr<nsIURI> uri;
  if (statURL.pwcsUrl) {
    nsDependentString url(statURL.pwcsUrl);
    nsresult rv = NS_NewURI(getter_AddRefs(uri), url);
    ::CoTaskMemFree(statURL.pwcsUrl);
    if (NS_FAILED(rv)) {
      // Got a corrupt or invalid URI, continue to the next entry.
      return HasMoreElements(_retval);
    }
  }

  nsDependentString title(statURL.pwcsTitle ? statURL.pwcsTitle : L"");

  bool lastVisitTimeIsValid;
  PRTime lastVisited = WinMigrationFileTimeToPRTime(&(statURL.ftLastVisited), &lastVisitTimeIsValid);

  mCachedNextEntry = do_CreateInstance("@mozilla.org/hash-property-bag;1");
  MOZ_ASSERT(mCachedNextEntry, "Should have instanced a new property bag");
  if (mCachedNextEntry) {
    mCachedNextEntry->SetPropertyAsInterface(NS_LITERAL_STRING("uri"), uri);
    mCachedNextEntry->SetPropertyAsAString(NS_LITERAL_STRING("title"), title);
    if (lastVisitTimeIsValid) {
      mCachedNextEntry->SetPropertyAsInt64(NS_LITERAL_STRING("time"), lastVisited);
    }

    *_retval = true;
  }

  if (statURL.pwcsTitle)
    ::CoTaskMemFree(statURL.pwcsTitle);

  return NS_OK;
}
コード例 #15
0
bool
GLXLibrary::SupportsTextureFromPixmap(gfxASurface* aSurface)
{
    if (!EnsureInitialized(mLibType)) {
        return false;
    }
    
    if (aSurface->GetType() != gfxSurfaceTypeXlib || !mUseTextureFromPixmap) {
        return false;
    }

    return true;
}
コード例 #16
0
NS_IMETHODIMP nsAbBSDirectory::DeleteDirectory(nsIAbDirectory *directory)
{
  NS_ENSURE_ARG_POINTER(directory);

  nsresult rv = EnsureInitialized();
  NS_ENSURE_SUCCESS(rv, rv);

  DIR_Server *server = nsnull;
  mServers.Get(directory, &server);

  if (!server)
    return NS_ERROR_FAILURE;

  GetDirectories getDirectories(server);
  mServers.EnumerateRead(GetDirectories_getDirectory,
                         (void*)&getDirectories);

  DIR_DeleteServerFromList(server);

  nsCOMPtr<nsIAbDirFactoryService> dirFactoryService = 
    do_GetService(NS_ABDIRFACTORYSERVICE_CONTRACTID,&rv);
  NS_ENSURE_SUCCESS (rv, rv);

  PRUint32 count = getDirectories.directories.Count();

  nsCOMPtr<nsIAbManager> abManager = do_GetService(NS_ABMANAGER_CONTRACTID);

  for (PRUint32 i = 0; i < count; i++) {
    nsCOMPtr<nsIAbDirectory> d = getDirectories.directories[i];

    mServers.Remove(d);
    rv = mSubDirectories.RemoveObject(d);

    if (abManager)
      abManager->NotifyDirectoryDeleted(this, d);

    nsCOMPtr<nsIRDFResource> resource(do_QueryInterface (d, &rv));
    nsCString uri;
    resource->GetValueUTF8(uri);

    nsCOMPtr<nsIAbDirFactory> dirFactory;
    rv = dirFactoryService->GetDirFactory(uri, getter_AddRefs(dirFactory));
    if (NS_FAILED(rv))
      continue;

    rv = dirFactory->DeleteDirectory(d);
  }

  return rv;
}
コード例 #17
0
int
AndroidGraphicBuffer::Lock(uint32_t aUsage, const nsIntRect& aRect, unsigned char **bits)
{
  if (!EnsureInitialized())
    return false;

  ARect rect;
  rect.left = aRect.x;
  rect.top = aRect.y;
  rect.right = aRect.x + aRect.width;
  rect.bottom = aRect.y + aRect.height;

  return sGLFunctions.fGraphicBufferLockRect(mHandle, GetAndroidUsage(aUsage), rect, bits);
}
コード例 #18
0
bool
AndroidGraphicBuffer::Bind()
{
  if (!EnsureInitialized())
    return false;

  if (!EnsureEGLImage()) {
    LOG("No valid EGLImage!");
    return false;
  }

  clearGLError();
  sGLFunctions.fImageTargetTexture2DOES(GL_TEXTURE_2D, mEGLImage);
  return ensureNoGLError("glEGLImageTargetTexture2DOES");
}
コード例 #19
0
bool
AndroidGraphicBuffer::EnsureEGLImage()
{
  if (mEGLImage)
    return true;


  if (!EnsureInitialized())
    return false;

  EGLint eglImgAttrs[] = { EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE, EGL_NONE };
  void* nativeBuffer = sGLFunctions.fGraphicBufferGetNativeBuffer(mHandle);

  mEGLImage = sGLFunctions.fCreateImageKHR(sGLFunctions.fGetDisplay(EGL_DEFAULT_DISPLAY), EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID, (EGLClientBuffer)nativeBuffer, eglImgAttrs);
  return mEGLImage != nullptr;
}
コード例 #20
0
NS_IMETHODIMP
nsCookiePermission::SetAccess(nsIURI         *aURI,
                              nsCookieAccess  aAccess)
{
  // Lazily initialize ourselves
  if (!EnsureInitialized())
    return NS_ERROR_UNEXPECTED;

  //
  // NOTE: nsCookieAccess values conveniently match up with
  //       the permission codes used by nsIPermissionManager.
  //       this is nice because it avoids conversion code.
  //
  return mPermMgr->Add(aURI, kPermissionType, aAccess,
                       nsIPermissionManager::EXPIRE_NEVER, 0);
}
コード例 #21
0
ファイル: KpInternetStream.cpp プロジェクト: xt9852/KeePassXT
HRESULT CKpInternetStream::ReadPartial(BYTE* pbBuffer, UINT64 uCount,
	UINT64* puRead)
{
	EnsureInitialized();

	if(m_hFile == NULL) { if(puRead != NULL) *puRead = 0; return STG_E_INVALIDHANDLE; }
	if(pbBuffer == NULL) CKPIS_R_FAIL(E_POINTER);
	if(uCount > static_cast<UINT64>(DWORD_MAX)) CKPIS_R_FAIL(E_INVALIDARG);

	DWORD dwRead = 0;
	const BOOL bRes = InternetReadFile(m_hFile, pbBuffer, static_cast<DWORD>(
		uCount), &dwRead);
	if(bRes == FALSE) CKPIS_R_FAIL(STG_E_READFAULT);

	if(puRead != NULL) *puRead = dwRead;
	return S_OK;
}
コード例 #22
0
ファイル: KpInternetStream.cpp プロジェクト: xt9852/KeePassXT
HRESULT CKpInternetStream::WritePartial(const BYTE* pbBuffer, UINT64 uCount,
	UINT64* puWritten)
{
	EnsureInitialized();

	if(m_hFile == NULL) { if(puWritten != NULL) *puWritten = 0; return STG_E_INVALIDHANDLE; }
	if(pbBuffer == NULL) CKPIS_W_FAIL(E_POINTER);
	if(uCount > static_cast<UINT64>(DWORD_MAX)) CKPIS_W_FAIL(E_INVALIDARG);

	DWORD dwWritten = 0;
	const BOOL bRes = InternetWriteFile(m_hFile, pbBuffer, static_cast<DWORD>(
		uCount), &dwWritten);
	if(bRes == FALSE) CKPIS_W_FAIL(STG_E_WRITEFAULT);

	if(puWritten != NULL) *puWritten = dwWritten;
	return S_OK;
}
コード例 #23
0
ファイル: device.cpp プロジェクト: Inner-room/libdshowcapture
bool HDevice::RenderFilters(const GUID &category, const GUID &type,
		IBaseFilter *filter, IBaseFilter *capture)
{
	HRESULT hr;

	if (!EnsureInitialized(L"HDevice::RenderFilters") ||
	    !EnsureInactive(L"HDevice::RenderFilters"))
		return false;

	hr = builder->RenderStream(&category, &type, filter, NULL, capture);
	if (FAILED(hr)) {
		WarningHR(L"HDevice::ConnectFilters: RenderStream failed", hr);
		return false;
	}

	return true;
}
コード例 #24
0
NS_IMETHODIMP nsAbBSDirectory::CreateNewDirectory(const nsAString &aDirName,
                                                  const nsACString &aURI,
                                                  PRUint32 aType,
                                                  const nsACString &aPrefName,
                                                  nsACString &aResult)
{
  nsresult rv = EnsureInitialized();
  NS_ENSURE_SUCCESS(rv, rv);

  /*
   * TODO
   * This procedure is still MDB specific
   * due to the dependence on the current
   * nsDirPref.cpp code
	 */

  nsCString URI(aURI);

  /*
   * The creation of the address book in the preferences
   * is very MDB implementation specific.
   * If the fileName attribute is null then it will
   * create an appropriate file name.
   * Somehow have to resolve this issue so that it
   * is more general.
   *
   */
  DIR_Server* server = nsnull;
  rv = DIR_AddNewAddressBook(aDirName, EmptyCString(), URI,
                             (DirectoryType)aType, aPrefName, &server);
  NS_ENSURE_SUCCESS (rv, rv);
  
  if (aType == PABDirectory) {
    // Add the URI property
    URI.AssignLiteral(kMDBDirectoryRoot);
    URI.Append(nsDependentCString(server->fileName));
  }

  aResult.Assign(server->prefName);

  rv = CreateDirectoriesFromFactory(URI, server, PR_TRUE /* notify */);
  NS_ENSURE_SUCCESS(rv,rv);
  return rv;
}
コード例 #25
0
NS_IMETHODIMP
nsCookiePermission::CanAccess(nsIURI         *aURI,
                              nsIChannel     *aChannel,
                              nsCookieAccess *aResult)
{
  // Check this protocol doesn't allow cookies
  bool hasFlags;
  nsresult rv =
    NS_URIChainHasFlags(aURI, nsIProtocolHandler::URI_FORBIDS_COOKIE_ACCESS,
                        &hasFlags);
  if (NS_FAILED(rv) || hasFlags) {
    *aResult = ACCESS_DENY;
    return NS_OK;
  }

  // Lazily initialize ourselves
  if (!EnsureInitialized())
    return NS_ERROR_UNEXPECTED;

  // finally, check with permission manager...
  rv = mPermMgr->TestPermission(aURI, kPermissionType, (PRUint32 *) aResult);
  if (NS_SUCCEEDED(rv)) {
    switch (*aResult) {
    // if we have one of the publicly-available values, just return it
    case nsIPermissionManager::UNKNOWN_ACTION: // ACCESS_DEFAULT
    case nsIPermissionManager::ALLOW_ACTION:   // ACCESS_ALLOW
    case nsIPermissionManager::DENY_ACTION:    // ACCESS_DENY
      break;

    // ACCESS_SESSION means the cookie can be accepted; the session 
    // downgrade will occur in CanSetCookie().
    case nsICookiePermission::ACCESS_SESSION:
      *aResult = ACCESS_ALLOW;
      break;

    // ack, an unknown type! just use the defaults.
    default:
      *aResult = ACCESS_DEFAULT;
    }
  }

  return rv;
}
コード例 #26
0
ファイル: SWRenderer.cpp プロジェクト: panoptics/openspades
		void SWRenderer::SetGameMap(client::GameMap *map) {
			SPADES_MARK_FUNCTION();
			if(map)
				EnsureInitialized();
			if(map == this->map)
				return;
			
			flatMapRenderer.reset();
			mapRenderer.reset();
			
			if(this->map)
				this->map->RemoveListener(this);
			this->map = map;
			if(this->map) {
				this->map->AddListener(this);
				flatMapRenderer = std::make_shared<SWFlatMapRenderer>(this, map);
				mapRenderer = std::make_shared<SWMapRenderer>(this, map, featureLevel);
			}
		}
コード例 #27
0
NS_IMETHODIMP nsAbBSDirectory::CreateDirectoryByURI(const nsAString &aDisplayName,
                                                    const nsACString &aURI)
{
  nsresult rv = EnsureInitialized();
  NS_ENSURE_SUCCESS(rv, rv);

  nsCString fileName;
  if (StringBeginsWith(aURI, NS_LITERAL_CSTRING(kMDBDirectoryRoot)))
    fileName = StringTail(aURI, aURI.Length() - kMDBDirectoryRootLen);

  DIR_Server * server = nsnull;
  rv = DIR_AddNewAddressBook(aDisplayName, fileName, aURI,
                             PABDirectory, EmptyCString(), &server);
  NS_ENSURE_SUCCESS(rv,rv);

  rv = CreateDirectoriesFromFactory(aURI, server, PR_TRUE /* notify */);
  NS_ENSURE_SUCCESS(rv,rv);
	return rv;
}
コード例 #28
0
ファイル: device.cpp プロジェクト: Inner-room/libdshowcapture
bool HDevice::SetVideoConfig(VideoConfig *config)
{
	ComPtr<IBaseFilter> filter;

	if (!EnsureInitialized(L"SetVideoConfig") ||
	    !EnsureInactive(L"SetVideoConfig"))
		return false;

	videoMediaType = NULL;
	graph->RemoveFilter(videoFilter);
	graph->RemoveFilter(videoCapture);
	videoFilter.Release();
	videoCapture.Release();

	if (!config)
		return true;

	if (config->name.empty() && config->path.empty()) {
		Error(L"No video device name or path specified");
		return false;
	}

	bool success = GetDeviceFilter(CLSID_VideoInputDeviceCategory,
			config->name.c_str(), config->path.c_str(), &filter);
	if (!success) {
		Error(L"Video device '%s': %s not found", config->name.c_str(),
				config->path.c_str());
		return false;
	}

	if (filter == NULL) {
		Error(L"Could not get video filter");
		return false;
	}

	videoConfig = *config;

	if (!SetupVideoCapture(filter, videoConfig))
		return false;

	*config = videoConfig;
	return true;
}
コード例 #29
0
ファイル: device.cpp プロジェクト: Inner-room/libdshowcapture
bool HDevice::ConnectFilters()
{
	bool success = true;

	if (!EnsureInitialized(L"ConnectFilters") ||
	    !EnsureInactive(L"ConnectFilters"))
		return false;

	if (videoCapture != NULL) {
		success = ConnectPins(PIN_CATEGORY_CAPTURE,
				MEDIATYPE_Video, videoFilter,
				videoCapture);
		if (!success) {
			success = RenderFilters(PIN_CATEGORY_CAPTURE,
					MEDIATYPE_Video, videoFilter,
					videoCapture);
		}
	}

	if ((audioCapture || audioOutput) && success) {
		IBaseFilter *filter = (audioCapture != nullptr) ?
			audioCapture.Get() : audioOutput.Get();

		if (audioCapture != nullptr)
			SetAudioBuffering(10);

		success = ConnectPins(PIN_CATEGORY_CAPTURE,
				MEDIATYPE_Audio, audioFilter,
				filter);
		if (!success) {
			success = RenderFilters(PIN_CATEGORY_CAPTURE,
					MEDIATYPE_Audio, audioFilter,
					filter);
		}
	}

	if (success)
		LogFilters(graph);

	return success;
}
コード例 #30
0
bool
AndroidGraphicBuffer::Reallocate(uint32_t aWidth, uint32_t aHeight, gfxImageFormat aFormat)
{
  if (!EnsureInitialized())
    return false;

  mWidth = aWidth;
  mHeight = aHeight;
  mFormat = aFormat;

  // Sometimes GraphicBuffer::reallocate just doesn't work. In those cases we'll just allocate a brand
  // new buffer. If reallocate fails once, never try it again.
  if (!gTryRealloc || sGLFunctions.fGraphicBufferReallocate(mHandle, aWidth, aHeight, GetAndroidFormat(aFormat)) != 0) {
    DestroyBuffer();
    EnsureBufferCreated();

    gTryRealloc = false;
  }

  return true;
}