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

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

Issue 2703423009: Add use counters for recently launched canvas features (Closed)
Patch Set: histo fix Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 4887 matching lines...) Expand 10 before | Expand all | Expand 10 after
4898 ExceptionState& exceptionState) { 4898 ExceptionState& exceptionState) {
4899 const char* funcName = getTexImageFunctionName(functionID); 4899 const char* funcName = getTexImageFunctionName(functionID);
4900 if (isContextLost()) 4900 if (isContextLost())
4901 return; 4901 return;
4902 if (!validateHTMLImageElement(funcName, image, exceptionState)) 4902 if (!validateHTMLImageElement(funcName, image, exceptionState))
4903 return; 4903 return;
4904 if (!validateTexImageBinding(funcName, functionID, target)) 4904 if (!validateTexImageBinding(funcName, functionID, target))
4905 return; 4905 return;
4906 4906
4907 RefPtr<Image> imageForRender = image->cachedImage()->getImage(); 4907 RefPtr<Image> imageForRender = image->cachedImage()->getImage();
4908 if (imageForRender && imageForRender->isSVGImage()) 4908 if (imageForRender && imageForRender->isSVGImage()) {
4909 if (canvas()) {
4910 UseCounter::count(canvas()->document(), UseCounter::SVGInWebGL);
4911 }
4909 imageForRender = drawImageIntoBuffer( 4912 imageForRender = drawImageIntoBuffer(
4910 imageForRender.release(), image->width(), image->height(), funcName); 4913 imageForRender.release(), image->width(), image->height(), funcName);
4914 }
4911 4915
4912 TexImageFunctionType functionType; 4916 TexImageFunctionType functionType;
4913 if (functionID == TexImage2D || functionID == TexImage3D) 4917 if (functionID == TexImage2D || functionID == TexImage3D)
4914 functionType = TexImage; 4918 functionType = TexImage;
4915 else 4919 else
4916 functionType = TexSubImage; 4920 functionType = TexSubImage;
4917 if (!imageForRender || 4921 if (!imageForRender ||
4918 !validateTexFunc(funcName, functionType, SourceHTMLImageElement, target, 4922 !validateTexFunc(funcName, functionType, SourceHTMLImageElement, target,
4919 level, internalformat, imageForRender->width(), 4923 level, internalformat, imageForRender->width(),
4920 imageForRender->height(), depth, 0, format, type, 4924 imageForRender->height(), depth, 0, format, type,
(...skipping 2908 matching lines...) Expand 10 before | Expand all | Expand 10 after
7829 7833
7830 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( 7834 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas(
7831 HTMLCanvasElementOrOffscreenCanvas& result) const { 7835 HTMLCanvasElementOrOffscreenCanvas& result) const {
7832 if (canvas()) 7836 if (canvas())
7833 result.setHTMLCanvasElement(canvas()); 7837 result.setHTMLCanvasElement(canvas());
7834 else 7838 else
7835 result.setOffscreenCanvas(offscreenCanvas()); 7839 result.setOffscreenCanvas(offscreenCanvas());
7836 } 7840 }
7837 7841
7838 } // namespace blink 7842 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698