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

Unified Diff: Source/core/platform/graphics/GraphicsContext3D.h

Issue 17859003: Allow DrawingBuffer to present to a bitmap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/platform/graphics/GraphicsContext3D.h
diff --git a/Source/core/platform/graphics/GraphicsContext3D.h b/Source/core/platform/graphics/GraphicsContext3D.h
index d0f7deb23b021898685f0f9195a60051230efdbb..283f288c22083715e13a802fbb13b226797576c5 100644
--- a/Source/core/platform/graphics/GraphicsContext3D.h
+++ b/Source/core/platform/graphics/GraphicsContext3D.h
@@ -789,6 +789,16 @@ public:
// End GraphicsContext3DImagePacking.cpp functions
+ // This is the order of bytes to use when doing a readback.
+ enum ReadbackOrder {
+ ReadbackRGBA,
+ ReadbackSkia
+ };
+
+ // Helper function which does a readback from the currently-bound
+ // framebuffer into a buffer of a certain size with 4-byte pixels.
+ void readBackFramebuffer(unsigned char* pixels, int width, int height, ReadbackOrder, AlphaOp);
+
private:
friend class Extensions3D;
@@ -804,6 +814,8 @@ private:
static bool packPixels(const uint8_t* sourceData, DataFormat sourceDataFormat, unsigned width, unsigned height, unsigned sourceUnpackAlignment, unsigned destinationFormat, unsigned destinationType, AlphaOp, void* destinationData, bool flipY);
void paintFramebufferToCanvas(int framebuffer, int width, int height, bool premultiplyAlpha, ImageBuffer*);
+ // Helper function to flip a bitmap vertically.
+ void flipVertically(uint8_t* data, int width, int height);
// Extensions3D support.
bool supportsExtension(const String& name);
@@ -826,6 +838,7 @@ private:
HashSet<String> m_requestableExtensions;
bool m_layerComposited;
bool m_preserveDrawingBuffer;
+ int m_packAlignment;
enum ResourceSafety {
ResourceSafetyUnknown,
@@ -843,6 +856,9 @@ private:
GrContext* m_grContext;
SkAutoTUnref<GrContext> m_ownedGrContext;
+
+ // Used to flip a bitmap vertically.
+ Vector<uint8_t> m_scanline;
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698