Changeset 90872 in webkit
- Timestamp:
- Jul 12, 2011 5:20:04 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 12 deleted
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r90869 r90872 1 2011-07-12 James Robinson <jamesr@chromium.org> 2 3 [chromium] Delete the unused legacy accelerated canvas 2d code 4 https://bugs.webkit.org/show_bug.cgi?id=64214 5 6 Reviewed by Stephen White. 7 8 This removes the legacy accelerated canvas 2d path and support logic since we (chromium) are no longer using 9 this codepath and it seems clear that no other port is interested. 10 11 Refactoring and removing unused code, so no new tests. 12 13 * WebCore.gypi: 14 * WebCore.xcodeproj/project.pbxproj: 15 * html/canvas/CanvasRenderingContext2D.cpp: 16 (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D): 17 (WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation): 18 (WebCore::CanvasRenderingContext2D::didDraw): 19 * html/canvas/CanvasRenderingContext2D.h: 20 * loader/EmptyClients.h: 21 * page/ChromeClient.h: 22 * page/Page.cpp: 23 (WebCore::Page::sharedGraphicsContext3D): 24 * page/Page.h: 25 * platform/graphics/GraphicsContext.cpp: 26 (WebCore::GraphicsContext::setSharedGraphicsContext3D): 27 (WebCore::GraphicsContext::syncSoftwareCanvas): 28 * platform/graphics/GraphicsContext.h: 29 * platform/graphics/GraphicsContext3D.h: 30 * platform/graphics/chromium/DrawingBufferChromium.cpp: 31 (WebCore::DrawingBuffer::setGrContext): 32 * platform/graphics/chromium/FontLinux.cpp: 33 (WebCore::Font::drawGlyphs): 34 * platform/graphics/chromium/cc/CCLayerSorter.cpp: 35 (WebCore::pointInTriangle): 36 * platform/graphics/gpu/BicubicShader.cpp: Removed. 37 * platform/graphics/gpu/BicubicShader.h: Removed. 38 * platform/graphics/gpu/ConvolutionShader.cpp: Removed. 39 * platform/graphics/gpu/ConvolutionShader.h: Removed. 40 * platform/graphics/gpu/GraphicsContextGPU.cpp: Removed. 41 * platform/graphics/gpu/GraphicsContextGPU.h: Removed. 42 * platform/graphics/gpu/SharedGraphicsContext3D.cpp: Removed. 43 * platform/graphics/gpu/SharedGraphicsContext3D.h: Removed. 44 * platform/graphics/gpu/SolidFillShader.cpp: Removed. 45 * platform/graphics/gpu/SolidFillShader.h: Removed. 46 * platform/graphics/gpu/TexShader.cpp: Removed. 47 * platform/graphics/gpu/TexShader.h: Removed. 48 * platform/graphics/skia/GraphicsContextSkia.cpp: 49 (WebCore::GraphicsContext::savePlatformState): 50 (WebCore::GraphicsContext::restorePlatformState): 51 (WebCore::GraphicsContext::addInnerRoundedRectClip): 52 (WebCore::GraphicsContext::clearRect): 53 (WebCore::GraphicsContext::clip): 54 (WebCore::GraphicsContext::canvasClip): 55 (WebCore::GraphicsContext::clipOut): 56 (WebCore::GraphicsContext::clipPath): 57 (WebCore::GraphicsContext::concatCTM): 58 (WebCore::GraphicsContext::setCTM): 59 (WebCore::GraphicsContext::drawConvexPolygon): 60 (WebCore::GraphicsContext::drawEllipse): 61 (WebCore::GraphicsContext::drawFocusRing): 62 (WebCore::GraphicsContext::drawLine): 63 (WebCore::GraphicsContext::drawLineForTextChecking): 64 (WebCore::GraphicsContext::drawLineForText): 65 (WebCore::GraphicsContext::drawRect): 66 (WebCore::GraphicsContext::fillPath): 67 (WebCore::GraphicsContext::fillRect): 68 (WebCore::GraphicsContext::fillRoundedRect): 69 (WebCore::GraphicsContext::scale): 70 (WebCore::GraphicsContext::setAlpha): 71 (WebCore::GraphicsContext::setPlatformCompositeOperation): 72 (WebCore::GraphicsContext::setPlatformFillColor): 73 (WebCore::GraphicsContext::setPlatformShadow): 74 (WebCore::GraphicsContext::strokeArc): 75 (WebCore::GraphicsContext::strokePath): 76 (WebCore::GraphicsContext::strokeRect): 77 (WebCore::GraphicsContext::rotate): 78 (WebCore::GraphicsContext::translate): 79 (WebCore::GraphicsContext::setSharedGraphicsContext3D): 80 (WebCore::GraphicsContext::syncSoftwareCanvas): 81 * platform/graphics/skia/ImageBufferSkia.cpp: 82 (WebCore::ImageBuffer::copyImage): 83 (WebCore::ImageBuffer::draw): 84 (WebCore::ImageBuffer::getUnmultipliedImageData): 85 (WebCore::ImageBuffer::getPremultipliedImageData): 86 (WebCore::ImageBuffer::putUnmultipliedImageData): 87 (WebCore::ImageBuffer::putPremultipliedImageData): 88 * platform/graphics/skia/ImageSkia.cpp: 89 (WebCore::BitmapImage::draw): 90 (WebCore::BitmapImageSingleFrameSkia::draw): 91 * platform/graphics/skia/NativeImageSkia.cpp: 92 (WebCore::NativeImageSkia::~NativeImageSkia): 93 * platform/graphics/skia/PlatformContextSkia.cpp: 94 (WebCore::PlatformContextSkia::PlatformContextSkia): 95 (WebCore::PlatformContextSkia::~PlatformContextSkia): 96 (WebCore::PlatformContextSkia::setSharedGraphicsContext3D): 97 (WebCore::PlatformContextSkia::makeGrContextCurrent): 98 * platform/graphics/skia/PlatformContextSkia.h: 99 1 100 2011-07-12 Emil A Eklund <eae@chromium.org> 2 101 -
trunk/Source/WebCore/WebCore.gypi
r90859 r90872 4249 4249 'platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp', 4250 4250 'platform/graphics/freetype/SimpleFontDataFreeType.cpp', 4251 'platform/graphics/gpu/BicubicShader.cpp',4252 'platform/graphics/gpu/BicubicShader.h',4253 'platform/graphics/gpu/ConvolutionShader.cpp',4254 'platform/graphics/gpu/ConvolutionShader.h',4255 4251 'platform/graphics/gpu/DrawingBuffer.cpp', 4256 4252 'platform/graphics/gpu/DrawingBuffer.h', 4257 'platform/graphics/gpu/GraphicsContextGPU.cpp',4258 'platform/graphics/gpu/GraphicsContextGPU.h',4259 'platform/graphics/gpu/LoopBlinnClassifier.cpp',4260 'platform/graphics/gpu/LoopBlinnClassifier.h',4261 'platform/graphics/gpu/LoopBlinnConstants.h',4262 'platform/graphics/gpu/LoopBlinnLocalTriangulator.cpp',4263 'platform/graphics/gpu/LoopBlinnLocalTriangulator.h',4264 'platform/graphics/gpu/LoopBlinnMathUtils.cpp',4265 'platform/graphics/gpu/LoopBlinnMathUtils.h',4266 'platform/graphics/gpu/LoopBlinnPathCache.cpp',4267 'platform/graphics/gpu/LoopBlinnPathCache.h',4268 'platform/graphics/gpu/LoopBlinnPathProcessor.cpp',4269 'platform/graphics/gpu/LoopBlinnPathProcessor.h',4270 'platform/graphics/gpu/LoopBlinnShader.cpp',4271 'platform/graphics/gpu/LoopBlinnShader.h',4272 'platform/graphics/gpu/LoopBlinnSolidFillShader.cpp',4273 'platform/graphics/gpu/LoopBlinnSolidFillShader.h',4274 'platform/graphics/gpu/LoopBlinnTextureCoords.cpp',4275 'platform/graphics/gpu/LoopBlinnTextureCoords.h',4276 'platform/graphics/gpu/PODArena.h',4277 'platform/graphics/gpu/PODInterval.h',4278 'platform/graphics/gpu/PODIntervalTree.h',4279 'platform/graphics/gpu/PODRedBlackTree.h',4280 4253 'platform/graphics/gpu/Shader.cpp', 4281 4254 'platform/graphics/gpu/Shader.h', 4282 'platform/graphics/gpu/SharedGraphicsContext3D.cpp',4283 'platform/graphics/gpu/SharedGraphicsContext3D.h',4284 'platform/graphics/gpu/SolidFillShader.cpp',4285 'platform/graphics/gpu/SolidFillShader.h',4286 'platform/graphics/gpu/TexShader.cpp',4287 'platform/graphics/gpu/TexShader.h',4288 4255 'platform/graphics/gpu/Texture.cpp', 4289 4256 'platform/graphics/gpu/Texture.h', -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r90863 r90872 1093 1093 498770DB1242C535002226BA /* DrawingBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 498770C21242C535002226BA /* DrawingBuffer.cpp */; }; 1094 1094 498770DC1242C535002226BA /* DrawingBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 498770C31242C535002226BA /* DrawingBuffer.h */; }; 1095 498770E41242C535002226BA /* PODArena.h in Headers */ = {isa = PBXBuildFile; fileRef = 498770CB1242C535002226BA /* PODArena.h */; };1096 498770E51242C535002226BA /* PODInterval.h in Headers */ = {isa = PBXBuildFile; fileRef = 498770CC1242C535002226BA /* PODInterval.h */; };1097 498770E61242C535002226BA /* PODIntervalTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 498770CD1242C535002226BA /* PODIntervalTree.h */; };1098 498770E71242C535002226BA /* PODRedBlackTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 498770CE1242C535002226BA /* PODRedBlackTree.h */; };1099 1095 498770E81242C535002226BA /* Shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 498770CF1242C535002226BA /* Shader.cpp */; }; 1100 1096 498770E91242C535002226BA /* Shader.h in Headers */ = {isa = PBXBuildFile; fileRef = 498770D01242C535002226BA /* Shader.h */; }; 1101 498770EA1242C535002226BA /* SharedGraphicsContext3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 498770D11242C535002226BA /* SharedGraphicsContext3D.cpp */; };1102 498770EB1242C535002226BA /* SharedGraphicsContext3D.h in Headers */ = {isa = PBXBuildFile; fileRef = 498770D21242C535002226BA /* SharedGraphicsContext3D.h */; };1103 498770EC1242C535002226BA /* SolidFillShader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 498770D31242C535002226BA /* SolidFillShader.cpp */; };1104 498770ED1242C535002226BA /* SolidFillShader.h in Headers */ = {isa = PBXBuildFile; fileRef = 498770D41242C535002226BA /* SolidFillShader.h */; };1105 498770EE1242C535002226BA /* TexShader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 498770D51242C535002226BA /* TexShader.cpp */; };1106 498770EF1242C535002226BA /* TexShader.h in Headers */ = {isa = PBXBuildFile; fileRef = 498770D61242C535002226BA /* TexShader.h */; };1107 1097 498770F01242C535002226BA /* Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 498770D71242C535002226BA /* Texture.cpp */; }; 1108 1098 498770F11242C535002226BA /* Texture.h in Headers */ = {isa = PBXBuildFile; fileRef = 498770D81242C535002226BA /* Texture.h */; }; … … 1118 1108 49A85B77138D58EE00ECB7B3 /* JSStreamEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49A85B75138D58EE00ECB7B3 /* JSStreamEvent.cpp */; }; 1119 1109 49A85B78138D58EE00ECB7B3 /* JSStreamEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 49A85B76138D58EE00ECB7B3 /* JSStreamEvent.h */; }; 1120 49B69E5E1254FEED007D57EB /* LoopBlinnClassifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49B69E551254FEED007D57EB /* LoopBlinnClassifier.cpp */; };1121 49B69E5F1254FEED007D57EB /* LoopBlinnClassifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 49B69E561254FEED007D57EB /* LoopBlinnClassifier.h */; };1122 49B69E601254FEED007D57EB /* LoopBlinnConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 49B69E571254FEED007D57EB /* LoopBlinnConstants.h */; };1123 49B69E631254FEED007D57EB /* LoopBlinnMathUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49B69E5A1254FEED007D57EB /* LoopBlinnMathUtils.cpp */; };1124 49B69E641254FEED007D57EB /* LoopBlinnMathUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 49B69E5B1254FEED007D57EB /* LoopBlinnMathUtils.h */; };1125 49B69E651254FEED007D57EB /* LoopBlinnTextureCoords.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49B69E5C1254FEED007D57EB /* LoopBlinnTextureCoords.cpp */; };1126 49B69E661254FEED007D57EB /* LoopBlinnTextureCoords.h in Headers */ = {isa = PBXBuildFile; fileRef = 49B69E5D1254FEED007D57EB /* LoopBlinnTextureCoords.h */; };1127 1110 49C7B9931042D2D30009D447 /* JSWebGLBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49C7B9801042D2D30009D447 /* JSWebGLBuffer.cpp */; }; 1128 1111 49C7B9941042D2D30009D447 /* JSWebGLBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 49C7B9811042D2D30009D447 /* JSWebGLBuffer.h */; }; … … 7607 7590 498770C21242C535002226BA /* DrawingBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DrawingBuffer.cpp; path = gpu/DrawingBuffer.cpp; sourceTree = "<group>"; }; 7608 7591 498770C31242C535002226BA /* DrawingBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DrawingBuffer.h; path = gpu/DrawingBuffer.h; sourceTree = "<group>"; }; 7609 498770CB1242C535002226BA /* PODArena.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PODArena.h; path = gpu/PODArena.h; sourceTree = "<group>"; };7610 498770CC1242C535002226BA /* PODInterval.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PODInterval.h; path = gpu/PODInterval.h; sourceTree = "<group>"; };7611 498770CD1242C535002226BA /* PODIntervalTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PODIntervalTree.h; path = gpu/PODIntervalTree.h; sourceTree = "<group>"; };7612 498770CE1242C535002226BA /* PODRedBlackTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PODRedBlackTree.h; path = gpu/PODRedBlackTree.h; sourceTree = "<group>"; };7613 7592 498770CF1242C535002226BA /* Shader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Shader.cpp; path = gpu/Shader.cpp; sourceTree = "<group>"; }; 7614 7593 498770D01242C535002226BA /* Shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Shader.h; path = gpu/Shader.h; sourceTree = "<group>"; }; 7615 498770D11242C535002226BA /* SharedGraphicsContext3D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SharedGraphicsContext3D.cpp; path = gpu/SharedGraphicsContext3D.cpp; sourceTree = "<group>"; };7616 498770D21242C535002226BA /* SharedGraphicsContext3D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SharedGraphicsContext3D.h; path = gpu/SharedGraphicsContext3D.h; sourceTree = "<group>"; };7617 498770D31242C535002226BA /* SolidFillShader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SolidFillShader.cpp; path = gpu/SolidFillShader.cpp; sourceTree = "<group>"; };7618 498770D41242C535002226BA /* SolidFillShader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SolidFillShader.h; path = gpu/SolidFillShader.h; sourceTree = "<group>"; };7619 498770D51242C535002226BA /* TexShader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TexShader.cpp; path = gpu/TexShader.cpp; sourceTree = "<group>"; };7620 498770D61242C535002226BA /* TexShader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TexShader.h; path = gpu/TexShader.h; sourceTree = "<group>"; };7621 7594 498770D71242C535002226BA /* Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Texture.cpp; path = gpu/Texture.cpp; sourceTree = "<group>"; }; 7622 7595 498770D81242C535002226BA /* Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Texture.h; path = gpu/Texture.h; sourceTree = "<group>"; }; … … 7633 7606 49A85B75138D58EE00ECB7B3 /* JSStreamEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStreamEvent.cpp; sourceTree = "<group>"; }; 7634 7607 49A85B76138D58EE00ECB7B3 /* JSStreamEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStreamEvent.h; sourceTree = "<group>"; }; 7635 49B69E551254FEED007D57EB /* LoopBlinnClassifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LoopBlinnClassifier.cpp; path = gpu/LoopBlinnClassifier.cpp; sourceTree = "<group>"; };7636 49B69E561254FEED007D57EB /* LoopBlinnClassifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LoopBlinnClassifier.h; path = gpu/LoopBlinnClassifier.h; sourceTree = "<group>"; };7637 49B69E571254FEED007D57EB /* LoopBlinnConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LoopBlinnConstants.h; path = gpu/LoopBlinnConstants.h; sourceTree = "<group>"; };7638 49B69E5A1254FEED007D57EB /* LoopBlinnMathUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LoopBlinnMathUtils.cpp; path = gpu/LoopBlinnMathUtils.cpp; sourceTree = "<group>"; };7639 49B69E5B1254FEED007D57EB /* LoopBlinnMathUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LoopBlinnMathUtils.h; path = gpu/LoopBlinnMathUtils.h; sourceTree = "<group>"; };7640 49B69E5C1254FEED007D57EB /* LoopBlinnTextureCoords.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LoopBlinnTextureCoords.cpp; path = gpu/LoopBlinnTextureCoords.cpp; sourceTree = "<group>"; };7641 49B69E5D1254FEED007D57EB /* LoopBlinnTextureCoords.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LoopBlinnTextureCoords.h; path = gpu/LoopBlinnTextureCoords.h; sourceTree = "<group>"; };7642 7608 49C7B9801042D2D30009D447 /* JSWebGLBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLBuffer.cpp; sourceTree = "<group>"; }; 7643 7609 49C7B9811042D2D30009D447 /* JSWebGLBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLBuffer.h; sourceTree = "<group>"; }; … … 13904 13870 498770C21242C535002226BA /* DrawingBuffer.cpp */, 13905 13871 498770C31242C535002226BA /* DrawingBuffer.h */, 13906 49B69E551254FEED007D57EB /* LoopBlinnClassifier.cpp */,13907 49B69E561254FEED007D57EB /* LoopBlinnClassifier.h */,13908 49B69E571254FEED007D57EB /* LoopBlinnConstants.h */,13909 49B69E5A1254FEED007D57EB /* LoopBlinnMathUtils.cpp */,13910 49B69E5B1254FEED007D57EB /* LoopBlinnMathUtils.h */,13911 49B69E5C1254FEED007D57EB /* LoopBlinnTextureCoords.cpp */,13912 49B69E5D1254FEED007D57EB /* LoopBlinnTextureCoords.h */,13913 498770CB1242C535002226BA /* PODArena.h */,13914 498770CC1242C535002226BA /* PODInterval.h */,13915 498770CD1242C535002226BA /* PODIntervalTree.h */,13916 498770CE1242C535002226BA /* PODRedBlackTree.h */,13917 13872 498770CF1242C535002226BA /* Shader.cpp */, 13918 13873 498770D01242C535002226BA /* Shader.h */, 13919 498770D11242C535002226BA /* SharedGraphicsContext3D.cpp */,13920 498770D21242C535002226BA /* SharedGraphicsContext3D.h */,13921 498770D31242C535002226BA /* SolidFillShader.cpp */,13922 498770D41242C535002226BA /* SolidFillShader.h */,13923 498770D51242C535002226BA /* TexShader.cpp */,13924 498770D61242C535002226BA /* TexShader.h */,13925 13874 498770D71242C535002226BA /* Texture.cpp */, 13926 13875 498770D81242C535002226BA /* Texture.h */, … … 22120 22069 BCE1C41B0D982980003B02F2 /* Location.h in Headers */, 22121 22070 A8239E0109B3CF8A00B60641 /* Logging.h in Headers */, 22122 49B69E5F1254FEED007D57EB /* LoopBlinnClassifier.h in Headers */,22123 49B69E601254FEED007D57EB /* LoopBlinnConstants.h in Headers */,22124 49B69E641254FEED007D57EB /* LoopBlinnMathUtils.h in Headers */,22125 49B69E661254FEED007D57EB /* LoopBlinnTextureCoords.h in Headers */,22126 22071 FD31603912B0267600C1A359 /* LowPass2FilterNode.h in Headers */, 22127 22072 656D37410ADBA5DE00A4554D /* MainResourceLoader.h in Headers */, … … 22299 22244 1AA8799011CBE846003C664F /* PluginStrategy.h in Headers */, 22300 22245 0AFDAC3D10F5448C00E1F3D2 /* PluginViewBase.h in Headers */, 22301 498770E41242C535002226BA /* PODArena.h in Headers */,22302 498770E51242C535002226BA /* PODInterval.h in Headers */,22303 498770E61242C535002226BA /* PODIntervalTree.h in Headers */,22304 498770E71242C535002226BA /* PODRedBlackTree.h in Headers */,22305 22246 B2B1F7170D00CAA8004AEA64 /* PointerEventsHitRules.h in Headers */, 22306 22247 84730D921248F0B300D3A9C9 /* PointLightSource.h in Headers */, … … 22566 22507 1A4A954E0B4EDCCB002D8C3C /* SharedBuffer.h in Headers */, 22567 22508 97B1F02F13B025D200F5103F /* SharedBufferChunkReader.h in Headers */, 22568 498770EB1242C535002226BA /* SharedGraphicsContext3D.h in Headers */,22569 22509 93309EA3099EB78C0056E581 /* SharedTimer.h in Headers */, 22570 22510 41E1B1D40FF5986900576B3B /* SharedWorker.h in Headers */, … … 22585 22525 510D4A38103165EE0049EA54 /* SocketStreamHandleClient.h in Headers */, 22586 22526 0A4844990CA44CB200B7BD48 /* SoftLinking.h in Headers */, 22587 498770ED1242C535002226BA /* SolidFillShader.h in Headers */,22588 22527 4B3043C70AE0370300A82647 /* Sound.h in Headers */, 22589 22528 84A81F3E0FC7DFF000955300 /* SourceAlpha.h in Headers */, … … 22913 22852 BCE3BEC30D222B1D007E06E4 /* TagNodeList.h in Headers */, 22914 22853 F55B3DD61251F12D003EF269 /* TelephoneInputType.h in Headers */, 22915 498770EF1242C535002226BA /* TexShader.h in Headers */,22916 22854 6550B6A6099DF0270090D781 /* Text.h in Headers */, 22917 22855 93309E17099E64920056E581 /* TextAffinity.h in Headers */, … … 25110 25048 A8239E0009B3CF8A00B60641 /* Logging.cpp in Sources */, 25111 25049 1402645E0AFDC19B005919E2 /* LoggingMac.mm in Sources */, 25112 49B69E5E1254FEED007D57EB /* LoopBlinnClassifier.cpp in Sources */,25113 49B69E631254FEED007D57EB /* LoopBlinnMathUtils.cpp in Sources */,25114 49B69E651254FEED007D57EB /* LoopBlinnTextureCoords.cpp in Sources */,25115 25050 FD31603812B0267600C1A359 /* LowPass2FilterNode.cpp in Sources */, 25116 25051 93E227E10AF589AD00D48324 /* MainResourceLoader.cpp in Sources */, … … 25463 25398 97B1F02E13B025CA00F5103F /* SharedBufferChunkReader.cpp in Sources */, 25464 25399 1A4A95520B4EDCFF002D8C3C /* SharedBufferMac.mm in Sources */, 25465 498770EA1242C535002226BA /* SharedGraphicsContext3D.cpp in Sources */,25466 25400 93309EA2099EB78C0056E581 /* SharedTimerMac.mm in Sources */, 25467 25401 41E1B1D30FF5986900576B3B /* SharedWorker.cpp in Sources */, … … 25482 25416 510D4A36103165EE0049EA54 /* SocketStreamHandleBase.cpp in Sources */, 25483 25417 51ABAE1F103C1913008C5260 /* SocketStreamHandleCFNet.cpp in Sources */, 25484 498770EC1242C535002226BA /* SolidFillShader.cpp in Sources */,25485 25418 4B3043C90AE0371D00A82647 /* SoundMac.mm in Sources */, 25486 25419 84A81F3D0FC7DFF000955300 /* SourceAlpha.cpp in Sources */, … … 25728 25661 BCE3BEC20D222B1D007E06E4 /* TagNodeList.cpp in Sources */, 25729 25662 F55B3DD51251F12D003EF269 /* TelephoneInputType.cpp in Sources */, 25730 498770EE1242C535002226BA /* TexShader.cpp in Sources */,25731 25663 6550B6A5099DF0270090D781 /* Text.cpp in Sources */, 25732 25664 372C00C4129611F1005C9575 /* TextBoundaries.cpp in Sources */, -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r90758 r90872 67 67 #include "DrawingBuffer.h" 68 68 #include "FrameView.h" 69 #include "GraphicsContext3D.h"70 #include "SharedGraphicsContext3D.h"71 69 #if USE(ACCELERATED_COMPOSITING) 72 70 #include "RenderLayer.h" … … 147 145 m_context3D = p->sharedGraphicsContext3D(); 148 146 if (m_context3D) { 149 m_drawingBuffer = m_context3D-> graphicsContext3D()->createDrawingBuffer(IntSize(canvas->width(), canvas->height()));147 m_drawingBuffer = m_context3D->createDrawingBuffer(IntSize(canvas->width(), canvas->height())); 150 148 if (!m_drawingBuffer) { 151 c->set SharedGraphicsContext3D(0, 0, IntSize());149 c->setGraphicsContext3D(0, 0, IntSize()); 152 150 m_context3D.clear(); 153 151 } else 154 c->set SharedGraphicsContext3D(m_context3D.get(), m_drawingBuffer.get(), IntSize(canvas->width(), canvas->height()));152 c->setGraphicsContext3D(m_context3D.get(), m_drawingBuffer.get(), IntSize(canvas->width(), canvas->height())); 155 153 } 156 154 } … … 174 172 #if ENABLE(ACCELERATED_2D_CANVAS) 175 173 if (GraphicsContext* context = drawingContext()) 176 context->set SharedGraphicsContext3D(0, 0, IntSize());174 context->setGraphicsContext3D(0, 0, IntSize()); 177 175 #endif 178 176 } … … 209 207 if (m_context3D && m_drawingBuffer) { 210 208 if (m_drawingBuffer->reset(IntSize(canvas()->width(), canvas()->height()))) { 211 c->set SharedGraphicsContext3D(m_context3D.get(), m_drawingBuffer.get(), IntSize(canvas()->width(), canvas()->height()));209 c->setGraphicsContext3D(m_context3D.get(), m_drawingBuffer.get(), IntSize(canvas()->width(), canvas()->height())); 212 210 } else { 213 c->set SharedGraphicsContext3D(0, 0, IntSize());211 c->setGraphicsContext3D(0, 0, IntSize()); 214 212 m_drawingBuffer.clear(); 215 213 m_context3D.clear(); … … 573 571 return; 574 572 c->setCompositeOperation(op); 575 #if ENABLE(ACCELERATED_2D_CANVAS)576 if (isAccelerated() && !m_context3D->supportsCompositeOp(op)) {577 c->setSharedGraphicsContext3D(0, 0, IntSize());578 m_drawingBuffer.clear();579 m_context3D.clear();580 // Mark as needing a style recalc so our compositing layer can be removed.581 canvas()->setNeedsStyleRecalc(SyntheticStyleChange);582 }583 #endif584 573 } 585 574 … … 1645 1634 } 1646 1635 1647 #if ENABLE(ACCELERATED_2D_CANVAS)1648 if (isAccelerated())1649 drawingContext()->markDirtyRect(enclosingIntRect(dirtyRect));1650 #endif1651 1636 #if ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING) 1652 1637 // If we are drawing to hardware and we have a composited layer, just call contentChanged(). … … 2039 2024 } 2040 2025 2041 void CanvasRenderingContext2D::paintRenderingResultsToCanvas()2042 {2043 #if ENABLE(ACCELERATED_2D_CANVAS)2044 if (GraphicsContext* c = drawingContext())2045 c->syncSoftwareCanvas();2046 #endif2047 }2048 2049 2026 #if ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING) 2050 2027 PlatformLayer* CanvasRenderingContext2D::platformLayer() const -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h
r87735 r90872 57 57 #if ENABLE(ACCELERATED_2D_CANVAS) 58 58 class DrawingBuffer; 59 class SharedGraphicsContext3D;59 class GraphicsContext3D; 60 60 #endif 61 61 … … 219 219 LineCap getLineCap() const { return state().m_lineCap; } 220 220 LineJoin getLineJoin() const { return state().m_lineJoin; } 221 222 virtual void paintRenderingResultsToCanvas();223 221 224 222 #if ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING) … … 306 304 #if ENABLE(ACCELERATED_2D_CANVAS) 307 305 RefPtr<DrawingBuffer> m_drawingBuffer; 308 RefPtr< SharedGraphicsContext3D> m_context3D;306 RefPtr<GraphicsContext3D> m_context3D; 309 307 #endif 310 308 }; -
trunk/Source/WebCore/loader/EmptyClients.h
r90856 r90872 63 63 namespace WebCore { 64 64 65 class SharedGraphicsContext3D;65 class GraphicsContext3D; 66 66 67 67 class EmptyPopupMenu : public PopupMenu { -
trunk/Source/WebCore/page/ChromeClient.h
r90856 r90872 61 61 class PopupMenuClient; 62 62 class SecurityOrigin; 63 class SharedGraphicsContext3D;63 class GraphicsContext3D; 64 64 class Widget; 65 65 -
trunk/Source/WebCore/page/Page.cpp
r86644 r90872 77 77 78 78 #if ENABLE(ACCELERATED_2D_CANVAS) 79 #include " SharedGraphicsContext3D.h"79 #include "GraphicsContext3D.h" 80 80 #endif 81 81 … … 753 753 } 754 754 755 SharedGraphicsContext3D* Page::sharedGraphicsContext3D()755 GraphicsContext3D* Page::sharedGraphicsContext3D() 756 756 { 757 757 #if ENABLE(ACCELERATED_2D_CANVAS) 758 if (!m_sharedGraphicsContext3D) 759 #if USE(SKIA) 760 // Temporary code to postpone massive test rebaselining 761 m_sharedGraphicsContext3D = SharedGraphicsContext3D::create(chrome(), settings()->legacyAccelerated2dCanvasEnabled() ? 0 : SharedGraphicsContext3D::UseSkiaGPU); 762 #else 763 m_sharedGraphicsContext3D = SharedGraphicsContext3D::create(chrome(), 0); 764 #endif 758 if (!m_sharedGraphicsContext3D) { 759 GraphicsContext3D::Attributes attr; 760 attr.depth = false; 761 attr.stencil = true; 762 attr.antialias = false; 763 attr.canRecoverFromContextLoss = false; // Canvas contexts can not handle lost contexts. 764 m_sharedGraphicsContext3D = GraphicsContext3D::create(attr, chrome()); 765 } 765 766 return m_sharedGraphicsContext3D.get(); 766 767 #else // !ENABLE(ACCELERATED_2D_CANVAS) -
trunk/Source/WebCore/page/Page.h
r86391 r90872 82 82 class ScrollableArea; 83 83 class Settings; 84 class SharedGraphicsContext3D;84 class GraphicsContext3D; 85 85 class SpeechInput; 86 86 class SpeechInputClient; … … 267 267 static void visitedStateChanged(PageGroup*, LinkHash visitedHash); 268 268 269 SharedGraphicsContext3D* sharedGraphicsContext3D();269 GraphicsContext3D* sharedGraphicsContext3D(); 270 270 271 271 #if ENABLE(DOM_STORAGE) … … 326 326 327 327 #if ENABLE(ACCELERATED_2D_CANVAS) 328 RefPtr< SharedGraphicsContext3D> m_sharedGraphicsContext3D;328 RefPtr<GraphicsContext3D> m_sharedGraphicsContext3D; 329 329 #endif 330 330 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp
r90832 r90872 686 686 687 687 #if !USE(SKIA) 688 void GraphicsContext::setSharedGraphicsContext3D(SharedGraphicsContext3D*, DrawingBuffer*, const IntSize&) 689 { 690 } 691 692 void GraphicsContext::syncSoftwareCanvas() 693 { 694 } 695 696 void GraphicsContext::markDirtyRect(const IntRect&) 688 void GraphicsContext::setGraphicsContext3D(GraphicsContext3D*, DrawingBuffer*, const IntSize&) 697 689 { 698 690 } -
trunk/Source/WebCore/platform/graphics/GraphicsContext.h
r90832 r90872 129 129 class RoundedRect; 130 130 class KURL; 131 class SharedGraphicsContext3D;131 class GraphicsContext3D; 132 132 class TextRun; 133 133 … … 513 513 #endif 514 514 515 void setSharedGraphicsContext3D(SharedGraphicsContext3D*, DrawingBuffer*, const IntSize&); 516 void syncSoftwareCanvas(); 517 void markDirtyRect(const IntRect&); // Hints that a portion of the backing store is dirty. 515 void setGraphicsContext3D(GraphicsContext3D*, DrawingBuffer*, const IntSize&); 518 516 519 517 static void adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, float strokeWidth, StrokeStyle); -
trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h
r89827 r90872 71 71 #else 72 72 typedef void* PlatformGraphicsContext3D; 73 #endif 74 75 #if PLATFORM(CHROMIUM) && USE(SKIA) 76 class GrContext; 73 77 #endif 74 78 … … 465 469 PlatformGraphicsContext3D platformGraphicsContext3D() const; 466 470 Platform3DObject platformTexture() const; 471 #if USE(SKIA) 472 GrContext* grContext(); 473 #endif 467 474 #if USE(ACCELERATED_COMPOSITING) 468 475 PlatformLayer* platformLayer() const; -
trunk/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp
r87987 r90872 35 35 #include "Extensions3DChromium.h" 36 36 #include "GraphicsContext3D.h" 37 #include "SharedGraphicsContext3D.h"38 37 39 38 #if USE(SKIA) … … 162 161 { 163 162 // We just take a ptr without referencing it, as we require that we never outlive 164 // the SharedGraphicsContext3D object that is giving us the context.163 // the GraphicsContext3D object that is giving us the context. 165 164 m_grContext = context; 166 165 } -
trunk/Source/WebCore/platform/graphics/chromium/FontLinux.cpp
r89988 r90872 111 111 } 112 112 113 gc->platformContext()-> prepareForSoftwareDraw();113 gc->platformContext()->makeGrContextCurrent(); 114 114 115 115 SkCanvas* canvas = gc->platformContext()->canvas(); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerSorter.cpp
r85814 r90872 27 27 #include "cc/CCLayerSorter.h" 28 28 29 #include "LoopBlinnMathUtils.h"30 29 #include "RenderSurfaceChromium.h" 31 30 #include "TransformationMatrix.h" … … 47 46 namespace WebCore { 48 47 49 using LoopBlinnMathUtils::pointInTriangle; 48 static bool pointInTriangle(const FloatPoint& point, 49 const FloatPoint& a, 50 const FloatPoint& b, 51 const FloatPoint& c) 52 { 53 // Algorithm from http://www.blackpawn.com/texts/pointinpoly/default.html 54 float x0 = c.x() - a.x(); 55 float y0 = c.y() - a.y(); 56 float x1 = b.x() - a.x(); 57 float y1 = b.y() - a.y(); 58 float x2 = point.x() - a.x(); 59 float y2 = point.y() - a.y(); 60 61 float dot00 = x0 * x0 + y0 * y0; 62 float dot01 = x0 * x1 + y0 * y1; 63 float dot02 = x0 * x2 + y0 * y2; 64 float dot11 = x1 * x1 + y1 * y1; 65 float dot12 = x1 * x2 + y1 * y2; 66 float denominator = dot00 * dot11 - dot01 * dot01; 67 if (!denominator) 68 // Triangle is zero-area. Treat query point as not being inside. 69 return false; 70 // Compute 71 float inverseDenominator = 1.0f / denominator; 72 float u = (dot11 * dot02 - dot01 * dot12) * inverseDenominator; 73 float v = (dot00 * dot12 - dot01 * dot02) * inverseDenominator; 74 75 return (u > 0.0f) && (v > 0.0f) && (u + v < 1.0f); 76 } 50 77 51 78 inline static float perpProduct(const FloatSize& u, const FloatSize& v) -
trunk/Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp
r90369 r90872 92 92 } 93 93 94 m_context->deleteFramebuffer(m_fbo); 95 m_fbo = 0; 94 if (m_fbo) { 95 m_context->deleteFramebuffer(m_fbo); 96 m_fbo = 0; 97 } 96 98 } 97 99 -
trunk/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
r90767 r90872 36 36 #include "FloatRect.h" 37 37 #include "Gradient.h" 38 #include "GraphicsContextGPU.h"39 38 #include "ImageBuffer.h" 40 39 #include "IntRect.h" … … 251 250 return; 252 251 253 if (platformContext()->useGPU())254 platformContext()->gpuCanvas()->save();255 256 252 // Save our private State. 257 253 platformContext()->save(); … … 262 258 if (paintingDisabled()) 263 259 return; 264 265 if (platformContext()->useGPU())266 platformContext()->gpuCanvas()->restore();267 260 268 261 // Restore our private State. … … 304 297 return; 305 298 306 platformContext()-> prepareForSoftwareDraw();299 platformContext()->makeGrContextCurrent(); 307 300 SkPath path; 308 301 path.addOval(r, SkPath::kCW_Direction); … … 330 323 return; 331 324 332 if (platformContext()->useGPU() && !platformContext()->canvasClipApplied()) {333 platformContext()->prepareForHardwareDraw();334 platformContext()->gpuCanvas()->clearRect(rect);335 return;336 }337 338 // Force a readback here (if we're using the GPU), since clearRect() is339 // incompatible with mixed-mode rendering.340 platformContext()->syncSoftwareCanvas();341 342 325 SkRect r = rect; 343 326 if (!isRectSkiaSafe(getCTM(), r)) … … 359 342 return; 360 343 361 platformContext()-> prepareForSoftwareDraw();344 platformContext()->makeGrContextCurrent(); 362 345 platformContext()->canvas()->clipRect(r); 363 346 } … … 372 355 return; 373 356 374 platformContext()-> prepareForSoftwareDraw();357 platformContext()->makeGrContextCurrent(); 375 358 platformContext()->clipPathAntiAliased(p); 376 359 } … … 380 363 if (paintingDisabled()) 381 364 return; 382 383 if (platformContext()->useGPU())384 platformContext()->gpuCanvas()->clipPath(path);385 365 386 366 const SkPath& p = *path.platformPath(); … … 408 388 return; 409 389 410 if (platformContext()->useGPU())411 platformContext()->gpuCanvas()->clipOut(p);412 413 390 const SkPath& path = *p.platformPath(); 414 391 if (!isPathSkiaSafe(getCTM(), path)) … … 423 400 return; 424 401 425 if (platformContext()->useGPU())426 platformContext()->gpuCanvas()->clipPath(pathToClip);427 428 402 SkPath path = *pathToClip.platformPath(); 429 403 if (!isPathSkiaSafe(getCTM(), path)) … … 439 413 return; 440 414 441 if (platformContext()->useGPU())442 platformContext()->gpuCanvas()->concatCTM(affine);443 444 415 platformContext()->canvas()->concat(affine); 445 416 } … … 449 420 if (paintingDisabled()) 450 421 return; 451 452 if (platformContext()->useGPU())453 platformContext()->gpuCanvas()->setCTM(affine);454 422 455 423 platformContext()->canvas()->setMatrix(affine); … … 478 446 return; 479 447 480 platformContext()-> prepareForSoftwareDraw();448 platformContext()->makeGrContextCurrent(); 481 449 482 450 SkPath path; … … 521 489 return; 522 490 523 platformContext()-> prepareForSoftwareDraw();491 platformContext()->makeGrContextCurrent(); 524 492 SkPaint paint; 525 493 platformContext()->setupPaintForFilling(&paint); … … 578 546 return; 579 547 580 platformContext()-> prepareForSoftwareDraw();548 platformContext()->makeGrContextCurrent(); 581 549 SkRegion focusRingRegion; 582 550 const SkScalar focusRingOutset = getFocusRingOutset(width); … … 613 581 return; 614 582 615 platformContext()-> prepareForSoftwareDraw();583 platformContext()->makeGrContextCurrent(); 616 584 617 585 FloatPoint p1 = point1; … … 659 627 return; 660 628 661 platformContext()-> prepareForSoftwareDraw();629 platformContext()->makeGrContextCurrent(); 662 630 663 631 // Create the pattern we'll use to draw the underline. … … 741 709 return; 742 710 743 platformContext()-> prepareForSoftwareDraw();711 platformContext()->makeGrContextCurrent(); 744 712 745 713 int thickness = SkMax32(static_cast<int>(strokeThickness()), 1); … … 763 731 return; 764 732 765 platformContext()-> prepareForSoftwareDraw();733 platformContext()->makeGrContextCurrent(); 766 734 767 735 SkRect r = rect; … … 779 747 return; 780 748 781 // FIXME: add support to GraphicsContextGPU for more than just solid fills.782 if (platformContext()->useGPU() && platformContext()->canAccelerate()) {783 platformContext()->prepareForHardwareDraw();784 platformContext()->gpuCanvas()->fillPath(pathToFill);785 return;786 }787 788 749 SkPath path = *pathToFill.platformPath(); 789 750 if (!isPathSkiaSafe(getCTM(), path)) 790 751 return; 791 752 792 platformContext()-> prepareForSoftwareDraw();753 platformContext()->makeGrContextCurrent(); 793 754 794 755 const GraphicsContextState& state = m_state; … … 813 774 } 814 775 815 if (platformContext()->useGPU() && platformContext()->canAccelerate()) {816 platformContext()->prepareForHardwareDraw();817 platformContext()->gpuCanvas()->fillRect(rect);818 return;819 }820 821 776 platformContext()->save(); 822 777 823 platformContext()-> prepareForSoftwareDraw();778 platformContext()->makeGrContextCurrent(); 824 779 825 780 SkPaint paint; … … 835 790 return; 836 791 837 if (platformContext()->useGPU() && platformContext()->canAccelerate()) { 838 platformContext()->prepareForHardwareDraw(); 839 platformContext()->gpuCanvas()->fillRect(rect, color, colorSpace); 840 return; 841 } 842 843 platformContext()->prepareForSoftwareDraw(); 792 platformContext()->makeGrContextCurrent(); 844 793 845 794 SkRect r = rect; … … 875 824 return; 876 825 877 platformContext()-> prepareForSoftwareDraw();826 platformContext()->makeGrContextCurrent(); 878 827 879 828 SkRect r = rect; … … 926 875 return; 927 876 928 if (platformContext()->useGPU())929 platformContext()->gpuCanvas()->scale(size);930 931 877 platformContext()->canvas()->scale(WebCoreFloatToSkScalar(size.width()), 932 878 WebCoreFloatToSkScalar(size.height())); … … 938 884 return; 939 885 940 if (platformContext()->useGPU())941 platformContext()->gpuCanvas()->setAlpha(alpha);942 943 886 platformContext()->setAlpha(alpha); 944 887 } … … 948 891 if (paintingDisabled()) 949 892 return; 950 951 if (platformContext()->useGPU())952 platformContext()->gpuCanvas()->setCompositeOperation(op);953 893 954 894 platformContext()->setXfermodeMode(WebCoreCompositeToSkiaComposite(op)); … … 1044 984 return; 1045 985 1046 if (platformContext()->useGPU())1047 platformContext()->gpuCanvas()->setFillColor(color, colorSpace);1048 1049 986 platformContext()->setFillColor(color.rgb()); 1050 987 } … … 1057 994 if (paintingDisabled()) 1058 995 return; 1059 1060 if (platformContext()->useGPU()) {1061 GraphicsContextGPU* canvas = platformContext()->gpuCanvas();1062 canvas->setShadowOffset(size);1063 canvas->setShadowBlur(blurFloat);1064 canvas->setShadowColor(color, colorSpace);1065 canvas->setShadowsIgnoreTransforms(m_state.shadowsIgnoreTransforms);1066 }1067 996 1068 997 // Detect when there's no effective shadow and clear the looper. … … 1184 1113 return; 1185 1114 1186 platformContext()-> prepareForSoftwareDraw();1115 platformContext()->makeGrContextCurrent(); 1187 1116 1188 1117 SkPaint paint; … … 1217 1146 return; 1218 1147 1219 platformContext()-> prepareForSoftwareDraw();1148 platformContext()->makeGrContextCurrent(); 1220 1149 1221 1150 SkPaint paint; … … 1232 1161 return; 1233 1162 1234 platformContext()-> prepareForSoftwareDraw();1163 platformContext()->makeGrContextCurrent(); 1235 1164 1236 1165 SkPaint paint; … … 1262 1191 return; 1263 1192 1264 if (platformContext()->useGPU())1265 platformContext()->gpuCanvas()->rotate(angleInRadians);1266 1267 1193 platformContext()->canvas()->rotate(WebCoreFloatToSkScalar( 1268 1194 angleInRadians * (180.0f / 3.14159265f))); … … 1274 1200 return; 1275 1201 1276 if (platformContext()->useGPU())1277 platformContext()->gpuCanvas()->translate(w, h);1278 1279 1202 platformContext()->canvas()->translate(WebCoreFloatToSkScalar(w), 1280 1203 WebCoreFloatToSkScalar(h)); 1281 1204 } 1282 1205 1283 void GraphicsContext::syncSoftwareCanvas() 1284 { 1285 platformContext()->syncSoftwareCanvas(); 1286 } 1287 1288 void GraphicsContext::setSharedGraphicsContext3D(SharedGraphicsContext3D* context, DrawingBuffer* framebuffer, const IntSize& size) 1289 { 1290 platformContext()->setSharedGraphicsContext3D(context, framebuffer, size); 1291 } 1292 1293 void GraphicsContext::markDirtyRect(const IntRect& rect) 1294 { 1295 platformContext()->markDirtyRect(rect); 1206 void GraphicsContext::setGraphicsContext3D(GraphicsContext3D* context, DrawingBuffer* framebuffer, const IntSize& size) 1207 { 1208 platformContext()->setGraphicsContext3D(context, framebuffer, size); 1296 1209 } 1297 1210 -
trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
r90847 r90872 39 39 #include "DrawingBuffer.h" 40 40 #include "GraphicsContext.h" 41 #include "GraphicsContextGPU.h"42 41 #include "ImageData.h" 43 42 #include "JPEGImageEncoder.h" … … 106 105 PassRefPtr<Image> ImageBuffer::copyImage() const 107 106 { 108 m_context->platformContext()-> syncSoftwareCanvas();107 m_context->platformContext()->makeGrContextCurrent(); 109 108 return BitmapImageSingleFrameSkia::create(*m_data.m_platformContext.bitmap(), true); 110 109 } … … 118 117 CompositeOperator op, bool useLowQualityScale) 119 118 { 120 if (m_data.m_platformContext.useGPU() && context->platformContext()->useGPU()) { 121 if (context->platformContext()->canAccelerate()) { 122 m_data.m_platformContext.prepareForHardwareDraw(); 123 DrawingBuffer* sourceDrawingBuffer = m_data.m_platformContext.gpuCanvas()->drawingBuffer(); 124 unsigned sourceTexture = static_cast<unsigned>(sourceDrawingBuffer->platformColorBuffer()); 125 FloatRect destRectNormalized(normalizeRect(destRect)); 126 FloatRect srcRectFlipped(normalizeRect(srcRect)); 127 srcRectFlipped.setY(m_size.height() - srcRect.y()); 128 srcRectFlipped.setHeight(-srcRect.height()); 129 context->platformContext()->prepareForHardwareDraw(); 130 context->platformContext()->gpuCanvas()->drawTexturedRect(sourceTexture, m_size, srcRectFlipped, destRectNormalized, styleColorSpace, op); 131 return; 132 } 133 m_data.m_platformContext.syncSoftwareCanvas(); 134 } 135 119 context->platformContext()->makeGrContextCurrent(); 136 120 RefPtr<Image> image = BitmapImageSingleFrameSkia::create(*m_data.m_platformContext.bitmap(), context == m_context); 137 121 context->drawImage(image.get(), styleColorSpace, destRect, srcRect, op, useLowQualityScale); … … 141 125 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect) 142 126 { 127 context->platformContext()->makeGrContextCurrent(); 143 128 RefPtr<Image> image = BitmapImageSingleFrameSkia::create(*m_data.m_platformContext.bitmap(), context == m_context); 144 129 image->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, op, destRect); … … 257 242 PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect) const 258 243 { 259 context()->platformContext()->syncSoftwareCanvas();244 m_context->platformContext()->makeGrContextCurrent(); 260 245 return getImageData<Unmultiplied>(rect, *context()->platformContext()->canvas()->getDevice(), m_size); 261 246 } … … 263 248 PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect) const 264 249 { 265 context()->platformContext()->syncSoftwareCanvas();250 m_context->platformContext()->makeGrContextCurrent(); 266 251 return getImageData<Premultiplied>(rect, *context()->platformContext()->canvas()->getDevice(), m_size); 267 252 } … … 338 323 void ImageBuffer::putUnmultipliedImageData(ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint) 339 324 { 340 context()->platformContext()->syncSoftwareCanvas();325 m_context->platformContext()->makeGrContextCurrent(); 341 326 putImageData<Unmultiplied>(source, sourceSize, sourceRect, destPoint, context()->platformContext()->canvas()->getDevice(), m_size); 342 327 } … … 344 329 void ImageBuffer::putPremultipliedImageData(ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint) 345 330 { 346 context()->platformContext()->syncSoftwareCanvas();331 m_context->platformContext()->makeGrContextCurrent(); 347 332 putImageData<Premultiplied>(source, sourceSize, sourceRect, destPoint, context()->platformContext()->canvas()->getDevice(), m_size); 348 333 } -
trunk/Source/WebCore/platform/graphics/skia/ImageSkia.cpp
r85422 r90872 37 37 #include "FloatRect.h" 38 38 #include "GraphicsContext.h" 39 #include "GraphicsContextGPU.h"40 39 #include "Logging.h" 41 40 #include "NativeImageSkia.h" … … 424 423 } 425 424 426 static void drawBitmapGLES2(GraphicsContext* ctxt, NativeImageSkia* bitmap, const FloatRect& srcRect, const FloatRect& dstRect, ColorSpace styleColorSpace, CompositeOperator compositeOp)427 {428 ctxt->platformContext()->prepareForHardwareDraw();429 GraphicsContextGPU* gpuCanvas = ctxt->platformContext()->gpuCanvas();430 Texture* texture = gpuCanvas->getTexture(bitmap);431 if (!texture) {432 ASSERT(bitmap->config() == SkBitmap::kARGB_8888_Config);433 ASSERT(bitmap->rowBytes() == bitmap->width() * 4);434 texture = gpuCanvas->createTexture(bitmap, Texture::BGRA8, bitmap->width(), bitmap->height());435 SkAutoLockPixels lock(*bitmap);436 ASSERT(bitmap->getPixels());437 texture->load(bitmap->getPixels());438 }439 gpuCanvas->drawTexturedRect(texture, srcRect, dstRect, styleColorSpace, compositeOp);440 }441 442 425 // ================================================ 443 426 // BitmapImage Class … … 500 483 return; // Nothing to draw. 501 484 502 if (ctxt->platformContext()->useGPU() && ctxt->platformContext()->canAccelerate()) { 503 drawBitmapGLES2(ctxt, bm, normSrcRect, normDstRect, colorSpace, compositeOp); 504 return; 505 } 506 507 ctxt->platformContext()->prepareForSoftwareDraw(); 485 ctxt->platformContext()->makeGrContextCurrent(); 508 486 509 487 paintSkBitmap(ctxt->platformContext(), … … 528 506 return; // Nothing to draw. 529 507 530 if (ctxt->platformContext()->useGPU() && ctxt->platformContext()->canAccelerate()) { 531 drawBitmapGLES2(ctxt, &m_nativeImage, srcRect, dstRect, styleColorSpace, compositeOp); 532 return; 533 } 534 535 ctxt->platformContext()->prepareForSoftwareDraw(); 508 ctxt->platformContext()->makeGrContextCurrent(); 536 509 537 510 paintSkBitmap(ctxt->platformContext(), -
trunk/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp
r67412 r90872 34 34 35 35 #include "NativeImageSkia.h" 36 #include " SharedGraphicsContext3D.h"36 #include "GraphicsContext3D.h" 37 37 #include "SkiaUtils.h" 38 38 … … 57 57 NativeImageSkia::~NativeImageSkia() 58 58 { 59 SharedGraphicsContext3D::removeTexturesFor(this);60 59 } 61 60 -
trunk/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
r90767 r90872 58 58 #include <wtf/Vector.h> 59 59 60 #if ENABLE(ACCELERATED_2D_CANVAS)61 #include "GraphicsContextGPU.h"62 #include "SharedGraphicsContext3D.h"63 #endif64 65 60 namespace WebCore { 66 61 … … 111 106 WTF::Vector<SkPath> m_antiAliasClipPaths; 112 107 InterpolationQuality m_interpolationQuality; 113 114 // If we currently have a canvas (non-antialiased path) clip applied.115 bool m_canvasClipApplied;116 108 117 109 PlatformContextSkia::State cloneInheritedProperties(); … … 138 130 , m_textDrawingMode(TextModeFill) 139 131 , m_interpolationQuality(InterpolationHigh) 140 , m_canvasClipApplied(false)141 132 { 142 133 } … … 161 152 , m_antiAliasClipPaths(other.m_antiAliasClipPaths) 162 153 , m_interpolationQuality(other.m_interpolationQuality) 163 , m_canvasClipApplied(other.m_canvasClipApplied)164 154 { 165 155 // Up the ref count of these. SkSafeRef does nothing if its argument is 0. … … 204 194 , m_printing(false) 205 195 , m_drawingToImageBuffer(false) 206 , m_accelerationMode(NoAcceleration) 207 , m_backingStoreState(None) 196 , m_gpuContext(0) 208 197 { 209 198 m_stateStack.append(State()); … … 216 205 PlatformContextSkia::~PlatformContextSkia() 217 206 { 218 #if ENABLE(ACCELERATED_2D_CANVAS)219 if (m_gpuCanvas) {220 // make sure everything related to this platform context has been flushed221 if (useSkiaGPU()) {222 SharedGraphicsContext3D* context = m_gpuCanvas->context();223 context->makeContextCurrent();224 context->grContext()->flush(0);225 }226 m_gpuCanvas->drawingBuffer()->setWillPublishCallback(nullptr);227 }228 #endif229 207 } 230 208 … … 560 538 void PlatformContextSkia::canvasClipPath(const SkPath& path) 561 539 { 562 m_state->m_canvasClipApplied = true;563 540 m_canvas->clipPath(path); 564 541 } … … 598 575 return false; 599 576 #else 600 if ( m_accelerationMode == SkiaGPU)577 if (useSkiaGPU()) 601 578 return false; 602 579 return skia::SupportsPlatformPaint(m_canvas); … … 675 652 } 676 653 677 bool PlatformContextSkia::canAccelerate() const 678 { 679 // Can't accelerate with a fill gradient or pattern. 680 const GraphicsContextState& state = m_gc->state(); 681 return !state.fillGradient.get() && !state.fillPattern.get(); 682 } 683 684 bool PlatformContextSkia::canvasClipApplied() const 685 { 686 return m_state->m_canvasClipApplied; 687 } 688 689 class WillPublishCallbackImpl : public DrawingBuffer::WillPublishCallback { 690 public: 691 static PassOwnPtr<WillPublishCallback> create(PlatformContextSkia* pcs) 692 { 693 return adoptPtr(new WillPublishCallbackImpl(pcs)); 694 } 695 696 virtual void willPublish() 697 { 698 m_pcs->prepareForHardwareDraw(); 699 } 700 701 private: 702 explicit WillPublishCallbackImpl(PlatformContextSkia* pcs) 703 : m_pcs(pcs) 704 { 705 } 706 707 PlatformContextSkia* m_pcs; 708 }; 709 710 void PlatformContextSkia::setSharedGraphicsContext3D(SharedGraphicsContext3D* context, DrawingBuffer* drawingBuffer, const WebCore::IntSize& size) 711 { 712 m_accelerationMode = NoAcceleration; 654 void PlatformContextSkia::setGraphicsContext3D(GraphicsContext3D* context, DrawingBuffer* drawingBuffer, const WebCore::IntSize& size) 655 { 656 m_gpuContext = context; 713 657 #if ENABLE(ACCELERATED_2D_CANVAS) 714 658 if (context && drawingBuffer) { 715 m_gpuCanvas = adoptPtr(new GraphicsContextGPU(context, drawingBuffer, size));716 m_uploadTexture.clear();717 drawingBuffer->setWillPublishCallback(WillPublishCallbackImpl::create(this));718 719 659 // use skia gpu rendering if available 720 660 GrContext* gr = context->grContext(); 721 661 if (gr) { 722 m_accelerationMode = SkiaGPU;723 724 662 context->makeContextCurrent(); 725 m_gpuCanvas->bindFramebuffer();663 drawingBuffer->bind(); 726 664 727 665 gr->resetContext(); … … 733 671 m_canvas->setDevice(new SkGpuDevice(gr, drawBufTex.get()))->unref(); 734 672 } else 735 m_accelerationMode = GPU; 736 } else { 737 syncSoftwareCanvas(); 738 m_uploadTexture.clear(); 739 m_gpuCanvas.clear(); 673 m_gpuContext = 0; 740 674 } 741 675 #endif 742 676 } 743 677 744 void PlatformContextSkia::prepareForSoftwareDraw() const 745 { 746 if (m_accelerationMode == SkiaGPU) { 747 #if ENABLE(ACCELERATED_2D_CANVAS) 748 if (m_gpuCanvas) 749 m_gpuCanvas->context()->makeContextCurrent(); 750 #endif 751 return; 752 } 753 754 if (m_backingStoreState == Hardware) { 755 // Depending on the blend mode we need to do one of a few things: 756 757 // * For associative blend modes, we can draw into an initially empty 758 // canvas and then composite the results on top of the hardware drawn 759 // results before the next hardware draw or swapBuffers(). 760 761 // * For non-associative blend modes we have to do a readback and then 762 // software draw. When we re-upload in this mode we have to blow 763 // away whatever is in the hardware backing store (do a copy instead 764 // of a compositing operation). 765 766 if (m_state->m_xferMode == SkXfermode::kSrcOver_Mode) { 767 // Note that we have rendering results in both the hardware and software backing stores. 768 m_backingStoreState = Mixed; 769 } else { 770 readbackHardwareToSoftware(); 771 // When we switch back to hardware copy the results, don't composite. 772 m_backingStoreState = Software; 773 } 774 } else if (m_backingStoreState == Mixed) { 775 if (m_state->m_xferMode != SkXfermode::kSrcOver_Mode) { 776 // Have to composite our currently software drawn data... 777 uploadSoftwareToHardware(CompositeSourceOver); 778 // then do a readback so we can hardware draw stuff. 779 readbackHardwareToSoftware(); 780 m_backingStoreState = Software; 781 } 782 } else if (m_backingStoreState == None) { 783 m_backingStoreState = Software; 784 } 785 } 786 787 void PlatformContextSkia::prepareForHardwareDraw() const 788 { 789 if (!(m_accelerationMode == GPU)) 790 return; 791 792 if (m_backingStoreState == Software) { 793 // Last drawn in software; upload everything we've drawn. 794 uploadSoftwareToHardware(CompositeCopy); 795 } else if (m_backingStoreState == Mixed) { 796 // Stuff in software/hardware, composite the software stuff on top of 797 // the hardware stuff. 798 uploadSoftwareToHardware(CompositeSourceOver); 799 } 800 m_backingStoreState = Hardware; 801 } 802 803 void PlatformContextSkia::syncSoftwareCanvas() const 804 { 805 if (m_accelerationMode == SkiaGPU) { 806 #if ENABLE(ACCELERATED_2D_CANVAS) 807 if (m_gpuCanvas) 808 m_gpuCanvas->context()->makeContextCurrent(); 809 #endif 810 return; 811 } 812 813 if (m_backingStoreState == Hardware) 814 readbackHardwareToSoftware(); 815 else if (m_backingStoreState == Mixed) { 816 // Have to composite our currently software drawn data.. 817 uploadSoftwareToHardware(CompositeSourceOver); 818 // then do a readback. 819 readbackHardwareToSoftware(); 820 m_backingStoreState = Software; 821 } 822 m_backingStoreState = Software; 823 } 824 825 void PlatformContextSkia::markDirtyRect(const IntRect& rect) 826 { 827 if (m_accelerationMode != GPU) 828 return; 829 830 switch (m_backingStoreState) { 831 case Software: 832 case Mixed: 833 m_softwareDirtyRect.unite(rect); 834 return; 835 case Hardware: 836 return; 837 default: 838 ASSERT_NOT_REACHED(); 839 } 840 } 841 842 void PlatformContextSkia::uploadSoftwareToHardware(CompositeOperator op) const 843 { 844 #if ENABLE(ACCELERATED_2D_CANVAS) 845 const SkBitmap& bitmap = m_canvas->getDevice()->accessBitmap(false); 846 SkAutoLockPixels lock(bitmap); 847 SharedGraphicsContext3D* context = m_gpuCanvas->context(); 848 if (!m_uploadTexture || m_uploadTexture->tiles().totalSizeX() < bitmap.width() || m_uploadTexture->tiles().totalSizeY() < bitmap.height()) 849 m_uploadTexture = context->createTexture(Texture::BGRA8, bitmap.width(), bitmap.height()); 850 851 m_uploadTexture->updateSubRect(bitmap.getPixels(), m_softwareDirtyRect); 852 AffineTransform identity; 853 gpuCanvas()->drawTexturedRect(m_uploadTexture.get(), m_softwareDirtyRect, m_softwareDirtyRect, identity, 1.0, ColorSpaceDeviceRGB, op, false); 854 // Clear out the region of the software canvas we just uploaded. 855 m_canvas->save(); 856 m_canvas->resetMatrix(); 857 SkRect bounds = m_softwareDirtyRect; 858 m_canvas->clipRect(bounds, SkRegion::kReplace_Op); 859 m_canvas->drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode); 860 m_canvas->restore(); 861 m_softwareDirtyRect.setWidth(0); // Clear dirty rect. 862 #endif 863 } 864 865 void PlatformContextSkia::readbackHardwareToSoftware() const 866 { 867 #if ENABLE(ACCELERATED_2D_CANVAS) 868 const SkBitmap& bitmap = m_canvas->getDevice()->accessBitmap(true); 869 SkAutoLockPixels lock(bitmap); 870 int width = bitmap.width(), height = bitmap.height(); 871 SharedGraphicsContext3D* context = m_gpuCanvas->context(); 872 m_gpuCanvas->bindFramebuffer(); 873 // Flips the image vertically. 874 for (int y = 0; y < height; ++y) { 875 uint32_t* pixels = bitmap.getAddr32(0, y); 876 if (context->supportsBGRA()) 877 context->readPixels(0, height - 1 - y, width, 1, Extensions3D::BGRA_EXT, GraphicsContext3D::UNSIGNED_BYTE, pixels); 878 else { 879 context->readPixels(0, height - 1 - y, width, 1, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, pixels); 880 for (int i = 0; i < width; ++i) { 881 uint32_t pixel = pixels[i]; 882 // Swizzles from RGBA -> BGRA. 883 pixels[i] = (pixel & 0xFF00FF00) | ((pixel & 0x00FF0000) >> 16) | ((pixel & 0x000000FF) << 16); 884 } 885 } 886 } 887 m_softwareDirtyRect.unite(IntRect(0, 0, width, height)); // Mark everything as dirty. 888 #endif 678 void PlatformContextSkia::makeGrContextCurrent() 679 { 680 if (m_gpuContext) 681 m_gpuContext->makeContextCurrent(); 889 682 } 890 683 -
trunk/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h
r90767 r90872 48 48 class DrawingBuffer; 49 49 class GraphicsContext3D; 50 class GraphicsContextGPU;51 50 class Texture; 52 51 … … 71 70 WTF_MAKE_NONCOPYABLE(PlatformContextSkia); 72 71 public: 73 enum AccelerationMode {74 NoAcceleration,75 GPU,76 SkiaGPU77 };78 79 72 // For printing, there shouldn't be any canvas. canvas can be NULL. If you 80 73 // supply a NULL canvas, you can also call setCanvas later. … … 185 178 bool hasImageResamplingHint() const; 186 179 187 bool canAccelerate() const; 188 bool canvasClipApplied() const; 189 AccelerationMode accelerationMode() const { return m_accelerationMode; } 190 bool useGPU() const { return m_accelerationMode == GPU; } 191 bool useSkiaGPU() const { return m_accelerationMode == SkiaGPU; } 192 void setSharedGraphicsContext3D(SharedGraphicsContext3D*, DrawingBuffer*, const IntSize&); 193 #if ENABLE(ACCELERATED_2D_CANVAS) 194 GraphicsContextGPU* gpuCanvas() const { return m_gpuCanvas.get(); } 195 #else 196 GraphicsContextGPU* gpuCanvas() const { return 0; } 197 #endif 198 // Call these before making a call that manipulates the underlying 199 // SkCanvas or WebCore::GraphicsContextGPU 200 void prepareForSoftwareDraw() const; 201 void prepareForHardwareDraw() const; 202 // Call to force the SkCanvas to contain all rendering results. 203 void syncSoftwareCanvas() const; 204 void markDirtyRect(const IntRect& rect); 180 bool useSkiaGPU() const { return m_gpuContext; } 181 void setGraphicsContext3D(GraphicsContext3D*, DrawingBuffer*, const IntSize&); 182 void makeGrContextCurrent(); 205 183 206 184 private: … … 209 187 void applyClipFromImage(const FloatRect&, const SkBitmap&); 210 188 void applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths); 211 212 void uploadSoftwareToHardware(CompositeOperator) const;213 void readbackHardwareToSoftware() const;214 189 215 190 // common code between setupPaintFor[Filling,Stroking] … … 236 211 bool m_printing; 237 212 bool m_drawingToImageBuffer; 238 AccelerationMode m_accelerationMode; 239 #if ENABLE(ACCELERATED_2D_CANVAS) 240 OwnPtr<GraphicsContextGPU> m_gpuCanvas; 241 mutable RefPtr<Texture> m_uploadTexture; 242 #endif 243 mutable enum { None, Software, Mixed, Hardware } m_backingStoreState; 244 mutable IntRect m_softwareDirtyRect; 213 GraphicsContext3D* m_gpuContext; 245 214 }; 246 215 -
trunk/Source/WebKit/chromium/ChangeLog
r90856 r90872 1 2011-07-12 James Robinson <jamesr@chromium.org> 2 3 [chromium] Delete the unused legacy accelerated canvas 2d code 4 https://bugs.webkit.org/show_bug.cgi?id=64214 5 6 Reviewed by Stephen White. 7 8 Adds a way to stash a GrContext* on a GraphicsContext3D. Previously, this was handled by 9 SharedGraphicsContext3D, but we don't need that class any more. This is used only for the shared 10 GraphicsContext3D stashed on the Page and shared by all accelerated canvases within the Page, for WebGL and 11 compositor contexts the GrContext is never set. 12 13 * src/GraphicsContext3DChromium.cpp: 14 (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal): 15 (WebCore::GraphicsContext3DInternal::~GraphicsContext3DInternal): 16 (WebCore::GraphicsContext3DInternal::grContext): 17 (WebCore::GraphicsContext3D::grContext): 18 * src/GraphicsContext3DInternal.h: 19 1 20 2011-07-12 Joseph Pecoraro <joepeck@webkit.org> 2 21 -
trunk/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp
r89393 r90872 62 62 #endif 63 63 64 #if USE(SKIA) 65 #include "GrContext.h" 66 #endif 67 64 68 // There are two levels of delegation in this file: 65 69 // … … 85 89 , m_layerComposited(false) 86 90 #if USE(SKIA) 91 , m_grContext(0) 87 92 #elif USE(CG) 88 93 , m_renderOutput(0) … … 98 103 if (m_renderOutput) 99 104 delete[] m_renderOutput; 105 #endif 106 #if USE(SKIA) 107 if (m_grContext) { 108 m_grContext->contextDestroyed(); 109 GrSafeUnref(m_grContext); 110 } 100 111 #endif 101 112 } … … 146 157 return m_impl->getPlatformTextureId(); 147 158 } 159 160 #if USE(SKIA) 161 GrContext* GraphicsContext3DInternal::grContext() 162 { 163 // Limit the number of textures we hold in the bitmap->texture cache. 164 static const int maxTextureCacheCount = 512; 165 // Limit the bytes allocated toward textures in the bitmap->texture cache. 166 static const size_t maxTextureCacheBytes = 50 * 1024 * 1024; 167 168 if (!m_grContext) { 169 m_grContext = GrContext::CreateGLShaderContext(); 170 if (m_grContext) 171 m_grContext->setTextureCacheLimits(maxTextureCacheCount, maxTextureCacheBytes); 172 } 173 return m_grContext; 174 } 175 #endif 148 176 149 177 void GraphicsContext3DInternal::prepareTexture() … … 962 990 return m_internal->platformTexture(); 963 991 } 992 993 #if USE(SKIA) 994 GrContext* GraphicsContext3D::grContext() 995 { 996 return m_internal->grContext(); 997 } 998 #endif 964 999 965 1000 void GraphicsContext3D::prepareTexture() -
trunk/Source/WebKit/chromium/src/GraphicsContext3DInternal.h
r89393 r90872 35 35 #endif 36 36 37 #if USE(SKIA) 38 class GrContext; 39 #endif 40 37 41 namespace WebKit { 38 42 class WebGraphicsContext3D; … … 63 67 PlatformGraphicsContext3D platformGraphicsContext3D() const; 64 68 Platform3DObject platformTexture() const; 69 #if USE(SKIA) 70 GrContext* grContext(); 71 #endif 65 72 66 73 bool makeContextCurrent(); … … 306 313 // used to resize the Canvas. 307 314 SkBitmap m_resizingBitmap; 315 316 GrContext* m_grContext; 308 317 #endif 309 318
Note: See TracChangeset
for help on using the changeset viewer.