Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(471)

Unified Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp

Issue 1974163003: Expose GpuMemoryBufferId through glGetImageivCHROMIUM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
index 13efb128ed04290fa71be195e82336d98328502a..f8ea5f0f47df002f98d8e050a42cf033f04df66d 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -934,6 +934,7 @@ void DrawingBuffer::deleteChromiumImageForTexture(TextureInfo* info)
m_gl->ReleaseTexImage2DCHROMIUM(info->parameters.target, info->imageId);
m_gl->DestroyImageCHROMIUM(info->imageId);
info->imageId = 0;
+ info->gpuMemoryBufferId = -1;
}
}
@@ -972,10 +973,14 @@ DrawingBuffer::TextureInfo DrawingBuffer::createTextureAndAllocateMemory(const I
GLuint textureId = createColorTexture(parameters);
m_gl->BindTexImage2DCHROMIUM(parameters.target, imageId);
+ GLint gpuMemoryBufferId = -1;
+ m_gl->GetImageivCHROMIUM(imageId, GC3D_GPU_MEMORY_BUFFER_ID, &gpuMemoryBufferId);
+ DCHECK_NE(-1, gpuMemoryBufferId);
TextureInfo info;
info.textureId = textureId;
info.imageId = imageId;
+ info.gpuMemoryBufferId = gpuMemoryBufferId;
info.parameters = parameters;
clearChromiumImageAlpha(info);
return info;
@@ -1002,6 +1007,12 @@ void DrawingBuffer::resizeTextureMemory(TextureInfo* info, const IntSize& size)
if (info->imageId) {
m_gl->BindTexture(info->parameters.target, info->textureId);
m_gl->BindTexImage2DCHROMIUM(info->parameters.target, info->imageId);
+
+ GLint gpuMemoryBufferId = -1;
+ m_gl->GetImageivCHROMIUM(info->imageId, GC3D_GPU_MEMORY_BUFFER_ID, &gpuMemoryBufferId);
+ DCHECK_NE(-1, gpuMemoryBufferId);
+ info->gpuMemoryBufferId = gpuMemoryBufferId;
+
clearChromiumImageAlpha(*info);
return;
}

Powered by Google App Engine
This is Rietveld 408576698