| Index: cc/resource_provider.cc
|
| diff --git a/cc/resource_provider.cc b/cc/resource_provider.cc
|
| index 9cc122c50aef0776e5905dfb7b7fd0f1f8cdd001..d3940622ee46e643a781449bbfb6112538fb76ca 100644
|
| --- a/cc/resource_provider.cc
|
| +++ b/cc/resource_provider.cc
|
| @@ -148,7 +148,7 @@ scoped_ptr<ResourceProvider> ResourceProvider::create(OutputSurface* context)
|
|
|
| ResourceProvider::~ResourceProvider()
|
| {
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| if (!context3d || !context3d->makeContextCurrent())
|
| return;
|
| m_textureUploader.reset();
|
| @@ -158,7 +158,7 @@ ResourceProvider::~ResourceProvider()
|
| WebGraphicsContext3D* ResourceProvider::graphicsContext3D()
|
| {
|
| DCHECK(m_threadChecker.CalledOnValidThread());
|
| - return m_outputSurface->Context3D();
|
| + return m_outputSurface->context3d();
|
| }
|
|
|
| bool ResourceProvider::inUseByConsumer(ResourceId id)
|
| @@ -204,7 +204,7 @@ ResourceProvider::ResourceId ResourceProvider::createGLTexture(const gfx::Size&
|
| DCHECK_LE(size.height(), m_maxTextureSize);
|
|
|
| DCHECK(m_threadChecker.CalledOnValidThread());
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| DCHECK(context3d);
|
|
|
| // Create and set texture properties. Allocation is delayed until needed.
|
| @@ -237,7 +237,7 @@ ResourceProvider::ResourceId ResourceProvider::createResourceFromExternalTexture
|
| {
|
| DCHECK(m_threadChecker.CalledOnValidThread());
|
|
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| DCHECK(context3d);
|
| GLC(context3d, context3d->bindTexture(GL_TEXTURE_2D, textureId));
|
| GLC(context3d, context3d->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
|
| @@ -288,22 +288,22 @@ void ResourceProvider::deleteResourceInternal(ResourceMap::iterator it)
|
| {
|
| Resource* resource = &it->second;
|
| if (resource->glId && !resource->external) {
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| DCHECK(context3d);
|
| GLC(context3d, context3d->deleteTexture(resource->glId));
|
| }
|
| if (resource->glUploadQueryId) {
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| DCHECK(context3d);
|
| GLC(context3d, context3d->deleteQueryEXT(resource->glUploadQueryId));
|
| }
|
| if (resource->glPixelBufferId) {
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| DCHECK(context3d);
|
| GLC(context3d, context3d->deleteBuffer(resource->glPixelBufferId));
|
| }
|
| if (!resource->mailbox.IsEmpty() && resource->external) {
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| DCHECK(context3d);
|
| unsigned syncPoint = resource->mailbox.sync_point();
|
| if (resource->glId) {
|
| @@ -345,7 +345,7 @@ void ResourceProvider::setPixels(ResourceId id, const uint8_t* image, const gfx:
|
|
|
| if (resource->glId) {
|
| DCHECK(!resource->pendingSetPixels);
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| DCHECK(context3d);
|
| DCHECK(m_textureUploader.get());
|
| context3d->bindTexture(GL_TEXTURE_2D, resource->glId);
|
| @@ -409,7 +409,7 @@ void ResourceProvider::flushUploads()
|
| void ResourceProvider::flush()
|
| {
|
| DCHECK(m_threadChecker.CalledOnValidThread());
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| if (context3d)
|
| context3d->flush();
|
| }
|
| @@ -417,7 +417,7 @@ void ResourceProvider::flush()
|
| bool ResourceProvider::shallowFlushIfSupported()
|
| {
|
| DCHECK(m_threadChecker.CalledOnValidThread());
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| if (!context3d || !m_useShallowFlush)
|
| return false;
|
|
|
| @@ -436,7 +436,7 @@ const ResourceProvider::Resource* ResourceProvider::lockForRead(ResourceId id)
|
| DCHECK(resource->allocated); // Uninitialized! Call setPixels or lockForWrite first.
|
|
|
| if (!resource->glId && resource->external && !resource->mailbox.IsEmpty()) {
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| DCHECK(context3d);
|
| if (resource->mailbox.sync_point()) {
|
| GLC(context3d, context3d->waitSyncPoint(resource->mailbox.sync_point()));
|
| @@ -588,7 +588,7 @@ ResourceProvider::ResourceProvider(OutputSurface* context)
|
| bool ResourceProvider::initialize()
|
| {
|
| DCHECK(m_threadChecker.CalledOnValidThread());
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| if (!context3d) {
|
| m_maxTextureSize = INT_MAX / 2;
|
| m_bestTextureFormat = GL_RGBA;
|
| @@ -659,7 +659,7 @@ void ResourceProvider::prepareSendToParent(const ResourceIdArray& resources, Tra
|
| DCHECK(m_threadChecker.CalledOnValidThread());
|
| list->sync_point = 0;
|
| list->resources.clear();
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| if (!context3d || !context3d->makeContextCurrent()) {
|
| // FIXME: Implement this path for software compositing.
|
| return;
|
| @@ -680,7 +680,7 @@ void ResourceProvider::prepareSendToChild(int child, const ResourceIdArray& reso
|
| DCHECK(m_threadChecker.CalledOnValidThread());
|
| list->sync_point = 0;
|
| list->resources.clear();
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| if (!context3d || !context3d->makeContextCurrent()) {
|
| // FIXME: Implement this path for software compositing.
|
| return;
|
| @@ -704,7 +704,7 @@ void ResourceProvider::prepareSendToChild(int child, const ResourceIdArray& reso
|
| void ResourceProvider::receiveFromChild(int child, const TransferableResourceList& resources)
|
| {
|
| DCHECK(m_threadChecker.CalledOnValidThread());
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| if (!context3d || !context3d->makeContextCurrent()) {
|
| // FIXME: Implement this path for software compositing.
|
| return;
|
| @@ -738,7 +738,7 @@ void ResourceProvider::receiveFromChild(int child, const TransferableResourceLis
|
| void ResourceProvider::receiveFromParent(const TransferableResourceList& resources)
|
| {
|
| DCHECK(m_threadChecker.CalledOnValidThread());
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| if (!context3d || !context3d->makeContextCurrent()) {
|
| // FIXME: Implement this path for software compositing.
|
| return;
|
| @@ -762,7 +762,7 @@ void ResourceProvider::receiveFromParent(const TransferableResourceList& resourc
|
| bool ResourceProvider::transferResource(WebGraphicsContext3D* context, ResourceId id, TransferableResource* resource)
|
| {
|
| DCHECK(m_threadChecker.CalledOnValidThread());
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| ResourceMap::iterator it = m_resources.find(id);
|
| CHECK(it != m_resources.end());
|
| Resource* source = &it->second;
|
| @@ -798,7 +798,7 @@ void ResourceProvider::acquirePixelBuffer(ResourceId id)
|
| DCHECK(!resource->exported);
|
|
|
| if (resource->glId) {
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| DCHECK(context3d);
|
| if (!resource->glPixelBufferId)
|
| resource->glPixelBufferId = context3d->createBuffer();
|
| @@ -833,7 +833,7 @@ void ResourceProvider::releasePixelBuffer(ResourceId id)
|
|
|
| if (resource->glId) {
|
| DCHECK(resource->glPixelBufferId);
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| DCHECK(context3d);
|
| context3d->bindBuffer(
|
| GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM,
|
| @@ -864,7 +864,7 @@ uint8_t* ResourceProvider::mapPixelBuffer(ResourceId id)
|
| DCHECK(!resource->exported);
|
|
|
| if (resource->glId) {
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| DCHECK(context3d);
|
| DCHECK(resource->glPixelBufferId);
|
| context3d->bindBuffer(
|
| @@ -894,7 +894,7 @@ void ResourceProvider::unmapPixelBuffer(ResourceId id)
|
| DCHECK(!resource->exported);
|
|
|
| if (resource->glId) {
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| DCHECK(context3d);
|
| DCHECK(resource->glPixelBufferId);
|
| context3d->bindBuffer(
|
| @@ -920,7 +920,7 @@ void ResourceProvider::setPixelsFromBuffer(ResourceId id)
|
| lazyAllocate(resource);
|
|
|
| if (resource->glId) {
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| DCHECK(context3d);
|
| DCHECK(resource->glPixelBufferId);
|
| context3d->bindTexture(GL_TEXTURE_2D, resource->glId);
|
| @@ -957,7 +957,7 @@ void ResourceProvider::setPixelsFromBuffer(ResourceId id)
|
| void ResourceProvider::bindForSampling(ResourceProvider::ResourceId resourceId, GLenum target, GLenum filter)
|
| {
|
| DCHECK(m_threadChecker.CalledOnValidThread());
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| ResourceMap::iterator it = m_resources.find(resourceId);
|
| DCHECK(it != m_resources.end());
|
| Resource* resource = &it->second;
|
| @@ -987,7 +987,7 @@ void ResourceProvider::beginSetPixels(ResourceId id)
|
| lockForWrite(id);
|
|
|
| if (resource->glId) {
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| DCHECK(context3d);
|
| DCHECK(resource->glPixelBufferId);
|
| context3d->bindTexture(GL_TEXTURE_2D, resource->glId);
|
| @@ -1039,7 +1039,7 @@ bool ResourceProvider::didSetPixelsComplete(ResourceId id) {
|
| DCHECK(resource->pendingSetPixels);
|
|
|
| if (resource->glId) {
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| DCHECK(context3d);
|
| DCHECK(resource->glUploadQueryId);
|
| unsigned complete = 1;
|
| @@ -1066,7 +1066,7 @@ void ResourceProvider::abortSetPixels(ResourceId id) {
|
| DCHECK(resource->pendingSetPixels);
|
|
|
| if (resource->glId) {
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| DCHECK(context3d);
|
| DCHECK(resource->glUploadQueryId);
|
| // CHROMIUM_async_pixel_transfers currently doesn't have a way to
|
| @@ -1097,7 +1097,7 @@ void ResourceProvider::lazyAllocate(Resource* resource) {
|
| if (resource->allocated || !resource->glId)
|
| return;
|
| resource->allocated = true;
|
| - WebGraphicsContext3D* context3d = m_outputSurface->Context3D();
|
| + WebGraphicsContext3D* context3d = m_outputSurface->context3d();
|
| gfx::Size& size = resource->size;
|
| GLenum format = resource->format;
|
| GLC(context3d, context3d->bindTexture(GL_TEXTURE_2D, resource->glId));
|
|
|