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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/ImageBuffer.h

Issue 1361043003: Revert of Make 2D canvas smarter about chosing whether or not to use GPU acceleration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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) 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 ~ImageBuffer(); 76 ~ImageBuffer();
77 77
78 void setClient(ImageBufferClient* client) { m_client = client; } 78 void setClient(ImageBufferClient* client) { m_client = client; }
79 79
80 const IntSize& size() const { return m_surface->size(); } 80 const IntSize& size() const { return m_surface->size(); }
81 bool isAccelerated() const { return m_surface->isAccelerated(); } 81 bool isAccelerated() const { return m_surface->isAccelerated(); }
82 bool isRecording() const { return m_surface->isRecording(); } 82 bool isRecording() const { return m_surface->isRecording(); }
83 void setHasExpensiveOp() { m_surface->setHasExpensiveOp(); } 83 void setHasExpensiveOp() { m_surface->setHasExpensiveOp(); }
84 bool isExpensiveToPaint() const { return m_surface->isExpensiveToPaint(); } 84 bool isExpensiveToPaint() const { return m_surface->isExpensiveToPaint(); }
85 void prepareSurfaceForPaintingIfNeeded() { m_surface->prepareSurfaceForPaint ingIfNeeded(); }
86 bool isSurfaceValid() const; 85 bool isSurfaceValid() const;
87 bool restoreSurface() const; 86 bool restoreSurface() const;
88 void didDraw(const FloatRect&) const; 87 void didDraw(const FloatRect&) const;
89 bool wasDrawnToAfterSnapshot() const { return m_snapshotState == DrawnToAfte rSnapshot; } 88 bool wasDrawnToAfterSnapshot() const { return m_snapshotState == DrawnToAfte rSnapshot; }
90 89
91 void setFilterQuality(SkFilterQuality filterQuality) { m_surface->setFilterQ uality(filterQuality); } 90 void setFilterQuality(SkFilterQuality filterQuality) { m_surface->setFilterQ uality(filterQuality); }
92 void setIsHidden(bool hidden) { m_surface->setIsHidden(hidden); } 91 void setIsHidden(bool hidden) { m_surface->setIsHidden(hidden); }
93 92
94 // Called by subclasses of ImageBufferSurface to install a new canvas object 93 // Called by subclasses of ImageBufferSurface to install a new canvas object
95 void resetCanvas(SkCanvas*) const; 94 void resetCanvas(SkCanvas*) const;
(...skipping 28 matching lines...) Expand all
124 // Destroys the TEXTURE_2D binding for the active texture unit of the passed context 123 // Destroys the TEXTURE_2D binding for the active texture unit of the passed context
125 bool copyToPlatformTexture(WebGraphicsContext3D*, Platform3DObject, GLenum, GLenum, GLint, bool, bool); 124 bool copyToPlatformTexture(WebGraphicsContext3D*, Platform3DObject, GLenum, GLenum, GLint, bool, bool);
126 125
127 bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*, SourceDrawingBuff er); 126 bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*, SourceDrawingBuff er);
128 127
129 void flush(); // process deferred draw commands immediately 128 void flush(); // process deferred draw commands immediately
130 void flushGpu(); // Like flush(), but flushes all the way down to the Gpu co ntext if the surface is accelerated 129 void flushGpu(); // Like flush(), but flushes all the way down to the Gpu co ntext if the surface is accelerated
131 130
132 void notifySurfaceInvalid(); 131 void notifySurfaceInvalid();
133 132
134 PassRefPtr<SkImage> newSkImageSnapshot(AccelerationHint) const; 133 PassRefPtr<SkImage> newSkImageSnapshot() const;
135 PassRefPtr<Image> newImageSnapshot(AccelerationHint = PreferNoAcceleration) const; 134 PassRefPtr<Image> newImageSnapshot() const;
136 135
137 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); } 136 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); }
138 String debugName() const { return "ImageBuffer"; } 137 String debugName() const { return "ImageBuffer"; }
139 138
140 void draw(GraphicsContext*, const FloatRect&, const FloatRect*, SkXfermode:: Mode); 139 void draw(GraphicsContext*, const FloatRect&, const FloatRect*, SkXfermode:: Mode);
141 140
142 private: 141 private:
143 ImageBuffer(PassOwnPtr<ImageBufferSurface>); 142 ImageBuffer(PassOwnPtr<ImageBufferSurface>);
144 143
145 enum SnapshotState { 144 enum SnapshotState {
(...skipping 14 matching lines...) Expand all
160 int height() const { return m_size.height(); } 159 int height() const { return m_size.height(); }
161 int width() const { return m_size.width(); } 160 int width() const { return m_size.width(); }
162 161
163 const unsigned char* m_data; 162 const unsigned char* m_data;
164 const IntSize m_size; 163 const IntSize m_size;
165 }; 164 };
166 165
167 } // namespace blink 166 } // namespace blink
168 167
169 #endif // ImageBuffer_h 168 #endif // ImageBuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698