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

Unified Diff: content/browser/compositor/offscreen_browser_compositor_output_surface.cc

Issue 2089753003: cc: Use the correct internal format for glCopyTexImage2D calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: copytextureformat: comments Created 4 years, 6 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: content/browser/compositor/offscreen_browser_compositor_output_surface.cc
diff --git a/content/browser/compositor/offscreen_browser_compositor_output_surface.cc b/content/browser/compositor/offscreen_browser_compositor_output_surface.cc
index 10b13f08beaeeacc5efc9e12c9ccf546150737f1..daaa970a0a8b2d45d82d388e619c25aa36864eea 100644
--- a/content/browser/compositor/offscreen_browser_compositor_output_surface.cc
+++ b/content/browser/compositor/offscreen_browser_compositor_output_surface.cc
@@ -30,6 +30,8 @@ using gpu::gles2::GLES2Interface;
namespace content {
+static cc::ResourceFormat kFboTextureFormat = cc::RGBA_8888;
+
OffscreenBrowserCompositorOutputSurface::
OffscreenBrowserCompositorOutputSurface(
scoped_refptr<ContextProviderCommandBuffer> context,
@@ -55,7 +57,7 @@ OffscreenBrowserCompositorOutputSurface::
void OffscreenBrowserCompositorOutputSurface::EnsureBackbuffer() {
is_backbuffer_discarded_ = false;
- if (!reflector_texture_.get()) {
+ if (!reflector_texture_) {
reflector_texture_.reset(new ReflectorTexture(context_provider()));
GLES2Interface* gl = context_provider_->ContextGL();
@@ -65,15 +67,15 @@ void OffscreenBrowserCompositorOutputSurface::EnsureBackbuffer() {
int texture_width = std::min(max_texture_size, surface_size_.width());
int texture_height = std::min(max_texture_size, surface_size_.height());
- cc::ResourceFormat format = cc::RGBA_8888;
gl->BindTexture(GL_TEXTURE_2D, reflector_texture_->texture_id());
gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- gl->TexImage2D(GL_TEXTURE_2D, 0, GLInternalFormat(format),
+ gl->TexImage2D(GL_TEXTURE_2D, 0, GLInternalFormat(kFboTextureFormat),
texture_width, texture_height, 0,
- GLDataFormat(format), GLDataType(format), nullptr);
+ GLDataFormat(kFboTextureFormat),
+ GLDataType(kFboTextureFormat), nullptr);
if (!fbo_)
gl->GenFramebuffers(1, &fbo_);
@@ -127,6 +129,11 @@ void OffscreenBrowserCompositorOutputSurface::BindFramebuffer() {
}
}
+GLenum
+OffscreenBrowserCompositorOutputSurface::GetFramebufferCopyTextureFormat() {
+ return GLCopyTextureInternalFormat(kFboTextureFormat);
+}
+
void OffscreenBrowserCompositorOutputSurface::SwapBuffers(
cc::CompositorFrame* frame) {
if (reflector_) {

Powered by Google App Engine
This is Rietveld 408576698