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

Side by Side Diff: Source/core/html/canvas/WebGLQuery.cpp

Issue 1205733005: Removed logic assuming ANY_SAMPLES_PASSED and ANY_SAMPLES_PASSED_CONSERVATIVE query types were inte… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « Source/core/html/canvas/WebGLQuery.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "config.h" 5 #include "config.h"
6 6
7 #include "core/html/canvas/WebGLQuery.h" 7 #include "core/html/canvas/WebGLQuery.h"
8 8
9 #include "core/html/canvas/WebGL2RenderingContextBase.h" 9 #include "core/html/canvas/WebGL2RenderingContextBase.h"
10 10
(...skipping 19 matching lines...) Expand all
30 WebGLQuery::WebGLQuery(WebGL2RenderingContextBase* ctx) 30 WebGLQuery::WebGLQuery(WebGL2RenderingContextBase* ctx)
31 : WebGLSharedPlatform3DObject(ctx) 31 : WebGLSharedPlatform3DObject(ctx)
32 , m_target(0) 32 , m_target(0)
33 { 33 {
34 setObject(ctx->webContext()->createQueryEXT()); 34 setObject(ctx->webContext()->createQueryEXT());
35 } 35 }
36 36
37 void WebGLQuery::setTarget(GLenum target) 37 void WebGLQuery::setTarget(GLenum target)
38 { 38 {
39 ASSERT(object()); 39 ASSERT(object());
40 ASSERT(isCompatibleTarget(target)); 40 ASSERT(!m_target);
41 m_target = target; 41 m_target = target;
42 } 42 }
43 43
44 bool WebGLQuery::isCompatibleTarget(GLenum target)
45 {
46 if (!m_target)
47 return true;
48
49 switch (target) {
50 // The SAMPLES_PASSED targets are interchangable.
51 case GL_ANY_SAMPLES_PASSED:
52 case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
53 return m_target == GL_ANY_SAMPLES_PASSED || m_target == GL_ANY_SAMPLES_P ASSED_CONSERVATIVE;
54 // Otherwise target is finalized the first time beginQuery() is called.
55 default:
56 return m_target == target;
57 }
58 }
59
60 void WebGLQuery::deleteObjectImpl(WebGraphicsContext3D* context3d) 44 void WebGLQuery::deleteObjectImpl(WebGraphicsContext3D* context3d)
61 { 45 {
62 context3d->deleteQueryEXT(m_object); 46 context3d->deleteQueryEXT(m_object);
63 m_object = 0; 47 m_object = 0;
64 } 48 }
65 49
66 } // namespace blink 50 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/canvas/WebGLQuery.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698