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

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

Issue 965223002: gpu: gpu decoder sets viewport size same to the size of the default framebuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: set onscreen size correctly Created 5 years, 10 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
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8c24d3cd1df5f8e04a458d173ec5106f5d3971bd..353cb9f5bdb245942d6e16eb4bd0fcf69e0a79a3 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -585,7 +585,7 @@ class GLES2DecoderImpl : public GLES2Decoder,
bool Initialize(const scoped_refptr<gfx::GLSurface>& surface,
const scoped_refptr<gfx::GLContext>& context,
bool offscreen,
- const gfx::Size& size,
+ const gfx::Size& offscreen_size,
const DisallowedFeatures& disallowed_features,
const std::vector<int32>& attribs) override;
void Destroy(bool have_context) override;
@@ -2434,7 +2434,7 @@ bool GLES2DecoderImpl::Initialize(
const scoped_refptr<gfx::GLSurface>& surface,
const scoped_refptr<gfx::GLContext>& context,
bool offscreen,
- const gfx::Size& size,
+ const gfx::Size& offscreen_size,
const DisallowedFeatures& disallowed_features,
const std::vector<int32>& attribs) {
TRACE_EVENT0("gpu", "GLES2DecoderImpl::Initialize");
@@ -2675,12 +2675,15 @@ bool GLES2DecoderImpl::Initialize(
// Allocate the render buffers at their initial size and check the status
// of the frame buffers is okay.
- if (!ResizeOffscreenFrameBuffer(size)) {
+ if (!ResizeOffscreenFrameBuffer(offscreen_size)) {
LOG(ERROR) << "Could not allocate offscreen buffer storage.";
Destroy(true);
return false;
}
+ state_.viewport_width = offscreen_size.width();
+ state_.viewport_height = offscreen_size.height();
+
// Allocate the offscreen saved color texture.
DCHECK(offscreen_saved_color_format_);
offscreen_saved_color_texture_->AllocateStorage(
@@ -2720,6 +2723,9 @@ bool GLES2DecoderImpl::Initialize(
glGetIntegerv(GL_STENCIL_BITS, &v);
back_buffer_has_stencil_ = attrib_parser.stencil_size != 0 && v > 0;
}
+
+ state_.viewport_width = surface->GetSize().width();
+ state_.viewport_height = surface->GetSize().height();
}
// OpenGL ES 2.0 implicitly enables the desktop GL capability
@@ -2742,9 +2748,6 @@ bool GLES2DecoderImpl::Initialize(
return false;
}
- state_.viewport_width = size.width();
- state_.viewport_height = size.height();
-
GLint viewport_params[4] = { 0 };
glGetIntegerv(GL_MAX_VIEWPORT_DIMS, viewport_params);
viewport_max_width_ = viewport_params[0];
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698