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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 1106773002: gpu: Disallow zero sized offscreen framebuffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed glGetError dcheck Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <list> 10 #include <list>
(...skipping 2446 matching lines...) Expand 10 before | Expand all | Expand 10 after
2457 bool GLES2DecoderImpl::Initialize( 2457 bool GLES2DecoderImpl::Initialize(
2458 const scoped_refptr<gfx::GLSurface>& surface, 2458 const scoped_refptr<gfx::GLSurface>& surface,
2459 const scoped_refptr<gfx::GLContext>& context, 2459 const scoped_refptr<gfx::GLContext>& context,
2460 bool offscreen, 2460 bool offscreen,
2461 const gfx::Size& offscreen_size, 2461 const gfx::Size& offscreen_size,
2462 const DisallowedFeatures& disallowed_features, 2462 const DisallowedFeatures& disallowed_features,
2463 const std::vector<int32>& attribs) { 2463 const std::vector<int32>& attribs) {
2464 TRACE_EVENT0("gpu", "GLES2DecoderImpl::Initialize"); 2464 TRACE_EVENT0("gpu", "GLES2DecoderImpl::Initialize");
2465 DCHECK(context->IsCurrent(surface.get())); 2465 DCHECK(context->IsCurrent(surface.get()));
2466 DCHECK(!context_.get()); 2466 DCHECK(!context_.get());
2467 DCHECK(!offscreen || !offscreen_size.IsEmpty());
hendrikw 2015/04/24 18:33:39 In my first change, I also DCHECK'd that glGetErro
2467 2468
2468 ContextCreationAttribHelper attrib_parser; 2469 ContextCreationAttribHelper attrib_parser;
2469 if (!attrib_parser.Parse(attribs)) 2470 if (!attrib_parser.Parse(attribs))
2470 return false; 2471 return false;
2471 2472
2472 surfaceless_ = surface->IsSurfaceless() && !offscreen; 2473 surfaceless_ = surface->IsSurfaceless() && !offscreen;
2473 2474
2474 set_initialized(); 2475 set_initialized();
2475 gpu_state_tracer_ = GPUStateTracer::Create(&state_); 2476 gpu_state_tracer_ = GPUStateTracer::Create(&state_);
2476 2477
(...skipping 10144 matching lines...) Expand 10 before | Expand all | Expand 10 after
12621 } 12622 }
12622 } 12623 }
12623 12624
12624 // Include the auto-generated part of this file. We split this because it means 12625 // Include the auto-generated part of this file. We split this because it means
12625 // we can easily edit the non-auto generated parts right here in this file 12626 // we can easily edit the non-auto generated parts right here in this file
12626 // instead of having to edit some template or the code generator. 12627 // instead of having to edit some template or the code generator.
12627 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 12628 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
12628 12629
12629 } // namespace gles2 12630 } // namespace gles2
12630 } // namespace gpu 12631 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698