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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp

Issue 1463573002: publish canvas context API stat metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cr Created 5 years, 1 month 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 "config.h" 5 #include "config.h"
6 #include "modules/webgl/WebGL2RenderingContextBase.h" 6 #include "modules/webgl/WebGL2RenderingContextBase.h"
7 7
8 #include "bindings/modules/v8/WebGLAny.h" 8 #include "bindings/modules/v8/WebGLAny.h"
9 #include "core/html/HTMLCanvasElement.h" 9 #include "core/html/HTMLCanvasElement.h"
10 #include "core/html/HTMLImageElement.h" 10 #include "core/html/HTMLImageElement.h"
11 #include "core/html/HTMLVideoElement.h" 11 #include "core/html/HTMLVideoElement.h"
12 #include "core/html/ImageData.h" 12 #include "core/html/ImageData.h"
13 #include "modules/webgl/WebGLActiveInfo.h" 13 #include "modules/webgl/WebGLActiveInfo.h"
14 #include "modules/webgl/WebGLBuffer.h" 14 #include "modules/webgl/WebGLBuffer.h"
15 #include "modules/webgl/WebGLFenceSync.h" 15 #include "modules/webgl/WebGLFenceSync.h"
16 #include "modules/webgl/WebGLFramebuffer.h" 16 #include "modules/webgl/WebGLFramebuffer.h"
17 #include "modules/webgl/WebGLProgram.h" 17 #include "modules/webgl/WebGLProgram.h"
18 #include "modules/webgl/WebGLQuery.h" 18 #include "modules/webgl/WebGLQuery.h"
19 #include "modules/webgl/WebGLRenderbuffer.h" 19 #include "modules/webgl/WebGLRenderbuffer.h"
20 #include "modules/webgl/WebGLSampler.h" 20 #include "modules/webgl/WebGLSampler.h"
21 #include "modules/webgl/WebGLSync.h" 21 #include "modules/webgl/WebGLSync.h"
22 #include "modules/webgl/WebGLTexture.h" 22 #include "modules/webgl/WebGLTexture.h"
23 #include "modules/webgl/WebGLTransformFeedback.h" 23 #include "modules/webgl/WebGLTransformFeedback.h"
24 #include "modules/webgl/WebGLUniformLocation.h" 24 #include "modules/webgl/WebGLUniformLocation.h"
25 #include "modules/webgl/WebGLVertexArrayObject.h" 25 #include "modules/webgl/WebGLVertexArrayObject.h"
26 #include "platform/NotImplemented.h" 26 #include "platform/NotImplemented.h"
27 #include "platform/graphics/CanvasMetrics.h"
27 #include "wtf/OwnPtr.h" 28 #include "wtf/OwnPtr.h"
28 #include "wtf/PassOwnPtr.h" 29 #include "wtf/PassOwnPtr.h"
29 30
30 namespace blink { 31 namespace blink {
31 32
32 namespace { 33 namespace {
33 34
34 WGC3Dsync syncObjectOrZero(const WebGLSync* object) 35 WGC3Dsync syncObjectOrZero(const WebGLSync* object)
35 { 36 {
36 return object ? object->object() : 0; 37 return object ? object->object() : 0;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, 104 GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
104 GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, 105 GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
105 GL_COMPRESSED_RGBA8_ETC2_EAC, 106 GL_COMPRESSED_RGBA8_ETC2_EAC,
106 GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, 107 GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
107 }; 108 };
108 109
109 WebGL2RenderingContextBase::WebGL2RenderingContextBase(HTMLCanvasElement* passed Canvas, PassOwnPtr<WebGraphicsContext3D> context, const WebGLContextAttributes& requestedAttributes) 110 WebGL2RenderingContextBase::WebGL2RenderingContextBase(HTMLCanvasElement* passed Canvas, PassOwnPtr<WebGraphicsContext3D> context, const WebGLContextAttributes& requestedAttributes)
110 : WebGLRenderingContextBase(passedCanvas, context, requestedAttributes) 111 : WebGLRenderingContextBase(passedCanvas, context, requestedAttributes)
111 { 112 {
112 m_supportedInternalFormatsStorage.insert(kSupportedInternalFormatsStorage, k SupportedInternalFormatsStorage + arraysize(kSupportedInternalFormatsStorage)); 113 m_supportedInternalFormatsStorage.insert(kSupportedInternalFormatsStorage, k SupportedInternalFormatsStorage + arraysize(kSupportedInternalFormatsStorage));
114 CanvasMetrics::countCanvasContextStat(CanvasMetrics::CanvasContextCreated);
Justin Novosad 2015/11/20 03:30:44 Can we make this one more specific: WebGLContextCr
zmin 2015/11/20 17:08:33 Removed.
113 } 115 }
114 116
115 WebGL2RenderingContextBase::~WebGL2RenderingContextBase() 117 WebGL2RenderingContextBase::~WebGL2RenderingContextBase()
116 { 118 {
117 m_readFramebufferBinding = nullptr; 119 m_readFramebufferBinding = nullptr;
118 120
119 m_boundCopyReadBuffer = nullptr; 121 m_boundCopyReadBuffer = nullptr;
120 m_boundCopyWriteBuffer = nullptr; 122 m_boundCopyWriteBuffer = nullptr;
121 m_boundPixelPackBuffer = nullptr; 123 m_boundPixelPackBuffer = nullptr;
122 m_boundPixelUnpackBuffer = nullptr; 124 m_boundPixelUnpackBuffer = nullptr;
(...skipping 2963 matching lines...) Expand 10 before | Expand all | Expand 10 after
3086 GLenum WebGL2RenderingContextBase::boundFramebufferColorFormat() 3088 GLenum WebGL2RenderingContextBase::boundFramebufferColorFormat()
3087 { 3089 {
3088 if (m_readFramebufferBinding && m_readFramebufferBinding->object()) 3090 if (m_readFramebufferBinding && m_readFramebufferBinding->object())
3089 return m_readFramebufferBinding->colorBufferFormat(); 3091 return m_readFramebufferBinding->colorBufferFormat();
3090 if (m_requestedAttributes.alpha()) 3092 if (m_requestedAttributes.alpha())
3091 return GL_RGBA; 3093 return GL_RGBA;
3092 return GL_RGB; 3094 return GL_RGB;
3093 } 3095 }
3094 3096
3095 } // namespace blink 3097 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698