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

Side by Side Diff: Source/core/platform/graphics/GraphicsContext3D.h

Issue 54653004: Break dependency of platform/graphics on html/ImageData.h (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move struct into ImageBuffer.h Created 7 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 /* 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 class WebGraphicsContext3DProvider; 53 class WebGraphicsContext3DProvider;
54 } 54 }
55 55
56 namespace WebCore { 56 namespace WebCore {
57 class DrawingBuffer; 57 class DrawingBuffer;
58 class Extensions3D; 58 class Extensions3D;
59 class GraphicsContext3DContextLostCallbackAdapter; 59 class GraphicsContext3DContextLostCallbackAdapter;
60 class GraphicsContext3DErrorMessageCallbackAdapter; 60 class GraphicsContext3DErrorMessageCallbackAdapter;
61 class Image; 61 class Image;
62 class ImageBuffer; 62 class ImageBuffer;
63 class ImageData;
64 class IntRect; 63 class IntRect;
65 class IntSize; 64 class IntSize;
66 65
67 struct ActiveInfo { 66 struct ActiveInfo {
68 String name; 67 String name;
69 GC3Denum type; 68 GC3Denum type;
70 GC3Dint size; 69 GC3Dint size;
71 }; 70 };
72 71
73 class GraphicsContext3D : public RefCounted<GraphicsContext3D> { 72 class GraphicsContext3D : public RefCounted<GraphicsContext3D> {
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 void vertexAttribPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dbo olean normalized, 660 void vertexAttribPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dbo olean normalized,
662 GC3Dsizei stride, GC3Dintptr offset); 661 GC3Dsizei stride, GC3Dintptr offset);
663 662
664 void viewport(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height); 663 void viewport(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
665 664
666 void markContextChanged(); 665 void markContextChanged();
667 void markLayerComposited(); 666 void markLayerComposited();
668 bool layerComposited() const; 667 bool layerComposited() const;
669 668
670 void paintRenderingResultsToCanvas(ImageBuffer*, DrawingBuffer*); 669 void paintRenderingResultsToCanvas(ImageBuffer*, DrawingBuffer*);
671 PassRefPtr<ImageData> paintRenderingResultsToImageData(DrawingBuffer*); 670 PassRefPtr<Uint8ClampedArray> paintRenderingResultsToImageData(DrawingBuffer *, int&, int&);
672 671
673 // Support for buffer creation and deletion 672 // Support for buffer creation and deletion
674 Platform3DObject createBuffer(); 673 Platform3DObject createBuffer();
675 Platform3DObject createFramebuffer(); 674 Platform3DObject createFramebuffer();
676 Platform3DObject createProgram(); 675 Platform3DObject createProgram();
677 Platform3DObject createRenderbuffer(); 676 Platform3DObject createRenderbuffer();
678 Platform3DObject createShader(GC3Denum); 677 Platform3DObject createShader(GC3Denum);
679 Platform3DObject createTexture(); 678 Platform3DObject createTexture();
680 679
681 void deleteBuffer(Platform3DObject); 680 void deleteBuffer(Platform3DObject);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 767
769 // Packs the contents of the given Image which is passed in |pixels| into th e passed Vector 768 // Packs the contents of the given Image which is passed in |pixels| into th e passed Vector
770 // according to the given format and type, and obeying the flipY and AlphaOp flags. 769 // according to the given format and type, and obeying the flipY and AlphaOp flags.
771 // Returns true upon success. 770 // Returns true upon success.
772 static bool packImageData(Image*, const void* pixels, GC3Denum format, GC3De num type, bool flipY, AlphaOp, DataFormat sourceFormat, unsigned width, unsigned height, unsigned sourceUnpackAlignment, Vector<uint8_t>& data); 771 static bool packImageData(Image*, const void* pixels, GC3Denum format, GC3De num type, bool flipY, AlphaOp, DataFormat sourceFormat, unsigned width, unsigned height, unsigned sourceUnpackAlignment, Vector<uint8_t>& data);
773 772
774 // Extracts the contents of the given ImageData into the passed Vector, 773 // Extracts the contents of the given ImageData into the passed Vector,
775 // packing the pixel data according to the given format and type, 774 // packing the pixel data according to the given format and type,
776 // and obeying the flipY and premultiplyAlpha flags. Returns true 775 // and obeying the flipY and premultiplyAlpha flags. Returns true
777 // upon success. 776 // upon success.
778 static bool extractImageData(ImageData*, GC3Denum format, GC3Denum type, boo l flipY, bool premultiplyAlpha, Vector<uint8_t>& data); 777 static bool extractImageData(const uint8_t*, const IntSize&, GC3Denum format , GC3Denum type, bool flipY, bool premultiplyAlpha, Vector<uint8_t>& data);
779 778
780 // Helper function which extracts the user-supplied texture 779 // Helper function which extracts the user-supplied texture
781 // data, applying the flipY and premultiplyAlpha parameters. 780 // data, applying the flipY and premultiplyAlpha parameters.
782 // If the data is not tightly packed according to the passed 781 // If the data is not tightly packed according to the passed
783 // unpackAlignment, the output data will be tightly packed. 782 // unpackAlignment, the output data will be tightly packed.
784 // Returns true if successful, false if any error occurred. 783 // Returns true if successful, false if any error occurred.
785 static bool extractTextureData(unsigned width, unsigned height, GC3Denum for mat, GC3Denum type, unsigned unpackAlignment, bool flipY, bool premultiplyAlpha, const void* pixels, Vector<uint8_t>& data); 784 static bool extractTextureData(unsigned width, unsigned height, GC3Denum for mat, GC3Denum type, unsigned unpackAlignment, bool flipY, bool premultiplyAlpha, const void* pixels, Vector<uint8_t>& data);
786 785
787 // End GraphicsContext3DImagePacking.cpp functions 786 // End GraphicsContext3DImagePacking.cpp functions
788 787
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 851
853 GrContext* m_grContext; 852 GrContext* m_grContext;
854 853
855 // Used to flip a bitmap vertically. 854 // Used to flip a bitmap vertically.
856 Vector<uint8_t> m_scanline; 855 Vector<uint8_t> m_scanline;
857 }; 856 };
858 857
859 } // namespace WebCore 858 } // namespace WebCore
860 859
861 #endif // GraphicsContext3D_h 860 #endif // GraphicsContext3D_h
OLDNEW
« no previous file with comments | « Source/core/html/canvas/WebGLRenderingContext.cpp ('k') | Source/core/platform/graphics/GraphicsContext3D.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698