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

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

Issue 2738163002: Enable CopyTextureCHROMIUM in Blink for Tex{Sub}Image2D with more cases (Closed)
Patch Set: rebase only--blink renaming and formatting Created 3 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 /* 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 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 } 1096 }
1097 return true; 1097 return true;
1098 } 1098 }
1099 1099
1100 // Copy from the source directly to the texture via the gpu, without a 1100 // Copy from the source directly to the texture via the gpu, without a
1101 // read-back to system memory. Source could be canvas or imageBitmap. 1101 // read-back to system memory. Source could be canvas or imageBitmap.
1102 void TexImageByGPU(TexImageFunctionID, 1102 void TexImageByGPU(TexImageFunctionID,
1103 WebGLTexture*, 1103 WebGLTexture*,
1104 GLenum target, 1104 GLenum target,
1105 GLint level, 1105 GLint level,
1106 GLint internalformat,
1107 GLenum type,
1108 GLint xoffset, 1106 GLint xoffset,
1109 GLint yoffset, 1107 GLint yoffset,
1110 GLint zoffset, 1108 GLint zoffset,
1111 CanvasImageSource*, 1109 CanvasImageSource*,
1112 const IntRect& source_sub_rectangle); 1110 const IntRect& source_sub_rectangle);
1113 virtual bool CanUseTexImageByGPU(TexImageFunctionID, 1111 virtual bool CanUseTexImageByGPU(GLenum type);
1114 GLint internalformat,
1115 GLenum type);
1116 1112
1117 virtual WebGLImageConversion::PixelStoreParams GetPackPixelStoreParams(); 1113 virtual WebGLImageConversion::PixelStoreParams GetPackPixelStoreParams();
1118 virtual WebGLImageConversion::PixelStoreParams GetUnpackPixelStoreParams( 1114 virtual WebGLImageConversion::PixelStoreParams GetUnpackPixelStoreParams(
1119 TexImageDimension); 1115 TexImageDimension);
1120 1116
1121 // Helper function for copyTex{Sub}Image, check whether the internalformat 1117 // Helper function for copyTex{Sub}Image, check whether the internalformat
1122 // and the color buffer format of the current bound framebuffer combination 1118 // and the color buffer format of the current bound framebuffer combination
1123 // is valid. 1119 // is valid.
1124 bool IsTexInternalFormatColorBufferCombinationValid( 1120 bool IsTexInternalFormatColorBufferCombinationValid(
1125 GLenum tex_internal_format, 1121 GLenum tex_internal_format,
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
1643 const CanvasContextCreationAttributes&, 1639 const CanvasContextCreationAttributes&,
1644 unsigned); 1640 unsigned);
1645 static bool SupportOwnOffscreenSurface(ExecutionContext*); 1641 static bool SupportOwnOffscreenSurface(ExecutionContext*);
1646 static std::unique_ptr<WebGraphicsContext3DProvider> 1642 static std::unique_ptr<WebGraphicsContext3DProvider>
1647 CreateContextProviderInternal(HTMLCanvasElement*, 1643 CreateContextProviderInternal(HTMLCanvasElement*,
1648 ScriptState*, 1644 ScriptState*,
1649 const CanvasContextCreationAttributes&, 1645 const CanvasContextCreationAttributes&,
1650 unsigned); 1646 unsigned);
1651 void TexImageCanvasByGPU(TexImageFunctionID, 1647 void TexImageCanvasByGPU(TexImageFunctionID,
1652 HTMLCanvasElement*, 1648 HTMLCanvasElement*,
1649 GLenum,
1653 GLuint, 1650 GLuint,
1654 GLenum,
1655 GLenum,
1656 GLint, 1651 GLint,
1657 GLint, 1652 GLint,
1653 const IntRect&);
1654 void TexImageBitmapByGPU(ImageBitmap*,
1655 GLenum,
1656 GLuint,
1657 bool,
1658 GLint, 1658 GLint,
1659 const IntRect& source_sub_rectangle); 1659 GLint,
1660 void TexImageBitmapByGPU(ImageBitmap*, GLuint, GLenum, GLenum, GLint, bool); 1660 const IntRect&);
1661 1661
1662 sk_sp<SkImage> MakeImageSnapshot(SkImageInfo&); 1662 sk_sp<SkImage> MakeImageSnapshot(SkImageInfo&);
1663 const unsigned version_; 1663 const unsigned version_;
1664 1664
1665 bool IsPaintable() const final { return GetDrawingBuffer(); } 1665 bool IsPaintable() const final { return GetDrawingBuffer(); }
1666 }; 1666 };
1667 1667
1668 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, 1668 DEFINE_TYPE_CASTS(WebGLRenderingContextBase,
1669 CanvasRenderingContext, 1669 CanvasRenderingContext,
1670 context, 1670 context,
1671 context->Is3d(), 1671 context->Is3d(),
1672 context.Is3d()); 1672 context.Is3d());
1673 1673
1674 } // namespace blink 1674 } // namespace blink
1675 1675
1676 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS( 1676 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(
1677 blink::WebGLRenderingContextBase::TextureUnitState); 1677 blink::WebGLRenderingContextBase::TextureUnitState);
1678 1678
1679 #endif // WebGLRenderingContextBase_h 1679 #endif // WebGLRenderingContextBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698