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

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

Issue 1367683002: 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: added nullptr check + fixed style check errors Created 5 years, 3 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) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 virtual void setFilterQuality(SkFilterQuality) { } 72 virtual void setFilterQuality(SkFilterQuality) { }
73 virtual void setIsHidden(bool) { } 73 virtual void setIsHidden(bool) { }
74 virtual void setImageBuffer(ImageBuffer*) { } 74 virtual void setImageBuffer(ImageBuffer*) { }
75 virtual PassRefPtr<SkPicture> getPicture(); 75 virtual PassRefPtr<SkPicture> getPicture();
76 virtual void finalizeFrame(const FloatRect &dirtyRect) { } 76 virtual void finalizeFrame(const FloatRect &dirtyRect) { }
77 virtual void draw(GraphicsContext*, const FloatRect& destRect, const FloatRe ct& srcRect, SkXfermode::Mode); 77 virtual void draw(GraphicsContext*, const FloatRect& destRect, const FloatRe ct& srcRect, SkXfermode::Mode);
78 virtual void setHasExpensiveOp() { } 78 virtual void setHasExpensiveOp() { }
79 virtual Platform3DObject getBackingTextureHandleForOverwrite() { return 0; } 79 virtual Platform3DObject getBackingTextureHandleForOverwrite() { return 0; }
80 virtual void flush(); // Execute all deferred rendering immediately 80 virtual void flush(); // Execute all deferred rendering immediately
81 virtual void flushGpu() { flush(); } // Like flush, but flushes all the way down to the GPU context if the surface uses the GPU 81 virtual void flushGpu() { flush(); } // Like flush, but flushes all the way down to the GPU context if the surface uses the GPU
82 virtual void prepareSurfaceForPaintingIfNeeded() { }
82 virtual bool writePixels(const SkImageInfo& origInfo, const void* pixels, si ze_t rowBytes, int x, int y); 83 virtual bool writePixels(const SkImageInfo& origInfo, const void* pixels, si ze_t rowBytes, int x, int y);
83 84
84 // May return nullptr if the surface is GPU-backed and the GPU context was l ost. 85 // May return nullptr if the surface is GPU-backed and the GPU context was l ost.
85 virtual PassRefPtr<SkImage> newImageSnapshot() = 0; 86 virtual PassRefPtr<SkImage> newImageSnapshot(AccelerationHint) = 0;
86 87
87 OpacityMode opacityMode() const { return m_opacityMode; } 88 OpacityMode opacityMode() const { return m_opacityMode; }
88 const IntSize& size() const { return m_size; } 89 const IntSize& size() const { return m_size; }
89 void notifyIsValidChanged(bool isValid) const; 90 void notifyIsValidChanged(bool isValid) const;
90 91
91 protected: 92 protected:
92 ImageBufferSurface(const IntSize&, OpacityMode); 93 ImageBufferSurface(const IntSize&, OpacityMode);
93 void clear(); 94 void clear();
94 95
95 private: 96 private:
96 OpacityMode m_opacityMode; 97 OpacityMode m_opacityMode;
97 IntSize m_size; 98 IntSize m_size;
98 }; 99 };
99 100
100 } // namespace blink 101 } // namespace blink
101 102
102 #endif 103 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698