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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2259523002: Fix gles2_conform_test failures when Mac switching to core profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo Created 4 years, 4 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: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 35f446c720f89f2752691a06f5e8eb770fafe581..866c3a35d5c34ad64765c9f21ff05b3e8e948332 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -899,6 +899,10 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
// or regular back buffer).
gfx::Size GetBoundReadFrameBufferSize();
+ // Get the service side ID for the bound read frame buffer.
+ // If it's back buffer, 0 is returned.
+ GLuint GetBoundReadFrameBufferServiceId();
+
// Get the format/type of the currently bound frame buffer (either FBO or
// regular back buffer).
// If the color image is a renderbuffer, returns 0 for type.
@@ -4314,6 +4318,24 @@ gfx::Size GLES2DecoderImpl::GetBoundReadFrameBufferSize() {
}
}
+GLuint GLES2DecoderImpl::GetBoundReadFrameBufferServiceId() {
+ Framebuffer* framebuffer =
+ GetFramebufferInfoForTarget(GL_READ_FRAMEBUFFER_EXT);
+ if (framebuffer) {
+ return framebuffer->service_id();
+ }
+ if (offscreen_resolved_frame_buffer_.get()) {
+ return offscreen_resolved_frame_buffer_->id();
+ }
+ if (offscreen_target_frame_buffer_.get()) {
+ return offscreen_target_frame_buffer_->id();
+ }
+ if (surface_.get()) {
+ return surface_->GetBackingFrameBufferObject();
+ }
+ return 0;
+}
+
GLenum GLES2DecoderImpl::GetBoundReadFrameBufferTextureType() {
Framebuffer* framebuffer =
GetFramebufferInfoForTarget(GL_READ_FRAMEBUFFER_EXT);
@@ -9038,7 +9060,7 @@ bool GLES2DecoderImpl::SimulateFixedAttribs(
GLuint max_vertex_accessed, bool* simulated, GLsizei primcount) {
DCHECK(simulated);
*simulated = false;
- if (gl_version_info().BehavesLikeGLES())
+ if (gl_version_info().SupportsFixedType())
return true;
if (!state_.vertex_attrib_manager->HaveFixedAttribs()) {
@@ -10266,8 +10288,7 @@ error::Error GLES2DecoderImpl::HandleVertexAttribPointer(
stride != 0 ? stride : group_size,
offset,
GL_FALSE);
- // We support GL_FIXED natively on EGL/GLES2 implementations
- if (type != GL_FIXED || gl_version_info().is_es) {
+ if (type != GL_FIXED || gl_version_info().SupportsFixedType()) {
glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
}
return error::kNoError;
@@ -13023,12 +13044,11 @@ void GLES2DecoderImpl::DoCopyTexImage2D(
GLint destX = dx;
GLint destY = dy;
if (requires_luma_blit) {
- copy_tex_image_blit_->DoCopyTexSubImage2DToLUMAComatabilityTexture(
+ copy_tex_image_blit_->DoCopyTexSubImage2DToLUMACompatibilityTexture(
this, texture->service_id(), texture->target(), target, format,
type, level, destX, destY, copyX, copyY, copyWidth, copyHeight,
- framebuffer_state_.bound_read_framebuffer->service_id(),
- framebuffer_state_.bound_read_framebuffer
- ->GetReadBufferInternalFormat());
+ GetBoundReadFrameBufferServiceId(),
+ GetBoundReadFrameBufferInternalFormat());
} else {
glCopyTexSubImage2D(target, level, destX, destY, copyX, copyY,
copyWidth, copyHeight);
@@ -13046,12 +13066,11 @@ void GLES2DecoderImpl::DoCopyTexImage2D(
final_internal_format, channels_exist, &source_texture_service_id,
&source_texture_target);
if (requires_luma_blit) {
- copy_tex_image_blit_->DoCopyTexImage2DToLUMAComatabilityTexture(
+ copy_tex_image_blit_->DoCopyTexImage2DToLUMACompatibilityTexture(
this, texture->service_id(), texture->target(), target, format,
type, level, internal_format, copyX, copyY, copyWidth, copyHeight,
- framebuffer_state_.bound_read_framebuffer->service_id(),
- framebuffer_state_.bound_read_framebuffer
- ->GetReadBufferInternalFormat());
+ GetBoundReadFrameBufferServiceId(),
+ GetBoundReadFrameBufferInternalFormat());
} else if (use_workaround) {
GLenum dest_texture_target = target;
GLenum framebuffer_target = features().chromium_framebuffer_multisample
@@ -13199,12 +13218,11 @@ void GLES2DecoderImpl::DoCopyTexSubImage2D(
if (!InitializeCopyTexImageBlitter("glCopyTexSubImage2D")) {
return;
}
- copy_tex_image_blit_->DoCopyTexSubImage2DToLUMAComatabilityTexture(
+ copy_tex_image_blit_->DoCopyTexSubImage2DToLUMACompatibilityTexture(
this, texture->service_id(), texture->target(), target,
internal_format, type, level, xoffset, yoffset, x, y, width, height,
- framebuffer_state_.bound_read_framebuffer->service_id(),
- framebuffer_state_.bound_read_framebuffer
- ->GetReadBufferInternalFormat());
+ GetBoundReadFrameBufferServiceId(),
+ GetBoundReadFrameBufferInternalFormat());
} else {
glCopyTexSubImage2D(target, level, destX, destY, copyX, copyY, copyWidth,
copyHeight);
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_copy_tex_image.cc ('k') | gpu/gles2_conform_support/gles2_conform_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698