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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/gpu/SharedContextRateLimiter.cpp

Issue 1832263002: Remove WGC3D typedefs and move WebGraphicsInfo to Platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: webgraphicsinfo: rebase Created 4 years, 8 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 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 "platform/graphics/gpu/SharedContextRateLimiter.h" 5 #include "platform/graphics/gpu/SharedContextRateLimiter.h"
6 6
7 #include "gpu/command_buffer/client/gles2_interface.h"
8 #include "platform/graphics/gpu/Extensions3DUtil.h" 7 #include "platform/graphics/gpu/Extensions3DUtil.h"
9 #include "public/platform/Platform.h" 8 #include "public/platform/Platform.h"
10 #include "public/platform/WebGraphicsContext3D.h" 9 #include "public/platform/WebGraphicsContext3D.h"
11 #include "public/platform/WebGraphicsContext3DProvider.h" 10 #include "public/platform/WebGraphicsContext3DProvider.h"
12 11
13 #ifndef GL_COMMANDS_COMPLETED_CHROMIUM 12 #ifndef GL_COMMANDS_COMPLETED_CHROMIUM
14 #define GL_COMMANDS_COMPLETED_CHROMIUM 0x84F7 13 #define GL_COMMANDS_COMPLETED_CHROMIUM 0x84F7
15 #endif 14 #endif
16 15
17 namespace blink { 16 namespace blink {
(...skipping 30 matching lines...) Expand all
48 47
49 m_queries.append(0); 48 m_queries.append(0);
50 if (m_canUseSyncQueries) 49 if (m_canUseSyncQueries)
51 gl->GenQueriesEXT(1, &m_queries.last()); 50 gl->GenQueriesEXT(1, &m_queries.last());
52 if (m_canUseSyncQueries) { 51 if (m_canUseSyncQueries) {
53 gl->BeginQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM, m_queries.last()); 52 gl->BeginQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM, m_queries.last());
54 gl->EndQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM); 53 gl->EndQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM);
55 } 54 }
56 if (m_queries.size() > m_maxPendingTicks) { 55 if (m_queries.size() > m_maxPendingTicks) {
57 if (m_canUseSyncQueries) { 56 if (m_canUseSyncQueries) {
58 WGC3Duint result; 57 GLuint result;
59 gl->GetQueryObjectuivEXT(m_queries.first(), GL_QUERY_RESULT_EXT, &re sult); 58 gl->GetQueryObjectuivEXT(m_queries.first(), GL_QUERY_RESULT_EXT, &re sult);
60 gl->DeleteQueriesEXT(1, &m_queries.first()); 59 gl->DeleteQueriesEXT(1, &m_queries.first());
61 m_queries.removeFirst(); 60 m_queries.removeFirst();
62 } else { 61 } else {
63 gl->Finish(); 62 gl->Finish();
64 reset(); 63 reset();
65 } 64 }
66 } 65 }
67 } 66 }
68 67
69 void SharedContextRateLimiter::reset() 68 void SharedContextRateLimiter::reset()
70 { 69 {
71 if (!m_contextProvider) 70 if (!m_contextProvider)
72 return; 71 return;
73 72
74 gpu::gles2::GLES2Interface* gl = m_contextProvider->contextGL(); 73 gpu::gles2::GLES2Interface* gl = m_contextProvider->contextGL();
75 if (gl && gl->GetGraphicsResetStatusKHR() == GL_NO_ERROR) { 74 if (gl && gl->GetGraphicsResetStatusKHR() == GL_NO_ERROR) {
76 while (m_queries.size() > 0) { 75 while (m_queries.size() > 0) {
77 gl->DeleteQueriesEXT(1, &m_queries.first()); 76 gl->DeleteQueriesEXT(1, &m_queries.first());
78 m_queries.removeFirst(); 77 m_queries.removeFirst();
79 } 78 }
80 } else { 79 } else {
81 m_queries.clear(); 80 m_queries.clear();
82 } 81 }
83 } 82 }
84 83
85 } // namespace blink 84 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698