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

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

Issue 2141793002: Improving canvas 2D performance by switching graphics rendering pipeline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor change Created 4 years, 5 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 PassRefPtr<SkPicture> getPicture() { return m_surface->getPicture(); } 140 PassRefPtr<SkPicture> getPicture() { return m_surface->getPicture(); }
141 141
142 void draw(GraphicsContext&, const FloatRect&, const FloatRect*, SkXfermode:: Mode); 142 void draw(GraphicsContext&, const FloatRect&, const FloatRect*, SkXfermode:: Mode);
143 143
144 void updateGPUMemoryUsage() const; 144 void updateGPUMemoryUsage() const;
145 static intptr_t getGlobalGPUMemoryUsage() { return s_globalGPUMemoryUsage; } 145 static intptr_t getGlobalGPUMemoryUsage() { return s_globalGPUMemoryUsage; }
146 static unsigned getGlobalAcceleratedImageBufferCount() { return s_globalAcce leratedImageBufferCount; } 146 static unsigned getGlobalAcceleratedImageBufferCount() { return s_globalAcce leratedImageBufferCount; }
147 intptr_t getGPUMemoryUsage() { return m_gpuMemoryUsage; } 147 intptr_t getGPUMemoryUsage() { return m_gpuMemoryUsage; }
148 148
149 void disableAcceleration();
150
151 WeakPtrFactory<ImageBuffer> m_weakPtrFactory;
152
149 protected: 153 protected:
150 ImageBuffer(std::unique_ptr<ImageBufferSurface>); 154 ImageBuffer(std::unique_ptr<ImageBufferSurface>);
151 155
152 private: 156 private:
153 enum SnapshotState { 157 enum SnapshotState {
154 InitialSnapshotState, 158 InitialSnapshotState,
155 DidAcquireSnapshot, 159 DidAcquireSnapshot,
156 DrawnToAfterSnapshot, 160 DrawnToAfterSnapshot,
157 }; 161 };
158 mutable SnapshotState m_snapshotState; 162 mutable SnapshotState m_snapshotState;
(...skipping 15 matching lines...) Expand all
174 int height() const { return m_size.height(); } 178 int height() const { return m_size.height(); }
175 int width() const { return m_size.width(); } 179 int width() const { return m_size.width(); }
176 180
177 const unsigned char* m_data; 181 const unsigned char* m_data;
178 const IntSize m_size; 182 const IntSize m_size;
179 }; 183 };
180 184
181 } // namespace blink 185 } // namespace blink
182 186
183 #endif // ImageBuffer_h 187 #endif // ImageBuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698