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

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

Issue 2653933003: Make stream captures work on canvases that are not in the DOM. (Closed)
Patch Set: Created 3 years, 11 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 bool PrepareTextureMailbox( 103 bool PrepareTextureMailbox(
104 cc::TextureMailbox* outMailbox, 104 cc::TextureMailbox* outMailbox,
105 std::unique_ptr<cc::SingleReleaseCallback>* outReleaseCallback) override; 105 std::unique_ptr<cc::SingleReleaseCallback>* outReleaseCallback) override;
106 106
107 // Callback for mailboxes given to the compositor from PrepareTextureMailbox. 107 // Callback for mailboxes given to the compositor from PrepareTextureMailbox.
108 void mailboxReleased(const gpu::Mailbox&, 108 void mailboxReleased(const gpu::Mailbox&,
109 const gpu::SyncToken&, 109 const gpu::SyncToken&,
110 bool lostResource); 110 bool lostResource);
111 111
112 // ImageBufferSurface implementation 112 // ImageBufferSurface implementation
113 void finalizeFrame(const FloatRect& dirtyRect); 113 void finalizeFrame();
114 void doPaintInvalidation(const FloatRect& dirtyRect);
114 void willWritePixels(); 115 void willWritePixels();
115 void willOverwriteAllPixels(); 116 void willOverwriteAllPixels();
116 void willOverwriteCanvas(); 117 void willOverwriteCanvas();
117 SkCanvas* canvas(); 118 SkCanvas* canvas();
118 void disableDeferral(DisableDeferralReason); 119 void disableDeferral(DisableDeferralReason);
119 bool checkSurfaceValid(); 120 bool checkSurfaceValid();
120 bool restoreSurface(); 121 bool restoreSurface();
121 WebLayer* layer() const; 122 WebLayer* layer() const;
122 bool isAccelerated() const; 123 bool isAccelerated() const;
123 void setFilterQuality(SkFilterQuality); 124 void setFilterQuality(SkFilterQuality);
124 void setIsHidden(bool); 125 void setIsHidden(bool);
125 void setImageBuffer(ImageBuffer*); 126 void setImageBuffer(ImageBuffer*);
126 void didDraw(const FloatRect&); 127 void didDraw(const FloatRect&);
127 bool writePixels(const SkImageInfo&, 128 bool writePixels(const SkImageInfo&,
128 const void* pixels, 129 const void* pixels,
129 size_t rowBytes, 130 size_t rowBytes,
130 int x, 131 int x,
131 int y); 132 int y);
132 void flush(); 133 void flush();
133 void flushGpu(); 134 void flushGpu();
134 void prepareSurfaceForPaintingIfNeeded();
135 bool isHidden() { return m_isHidden; } 135 bool isHidden() { return m_isHidden; }
136 OpacityMode opacityMode() { return m_opacityMode; } 136 OpacityMode opacityMode() { return m_opacityMode; }
137 void dontUseIdleSchedulingForTesting() { 137 void dontUseIdleSchedulingForTesting() {
138 m_dontUseIdleSchedulingForTesting = true; 138 m_dontUseIdleSchedulingForTesting = true;
139 } 139 }
140 140
141 void beginDestruction(); 141 void beginDestruction();
142 void hibernate(); 142 void hibernate();
143 bool isHibernating() const { return m_hibernationImage.get(); } 143 bool isHibernating() const { return m_hibernationImage.get(); }
144 sk_sp<SkColorSpace> colorSpace() const { return m_colorSpace; } 144 sk_sp<SkColorSpace> colorSpace() const { return m_colorSpace; }
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 // Each element in this vector represents an IOSurface backed texture that 297 // Each element in this vector represents an IOSurface backed texture that
298 // is ready to be reused. 298 // is ready to be reused.
299 // Elements in this vector can safely be purged in low memory conditions. 299 // Elements in this vector can safely be purged in low memory conditions.
300 Vector<RefPtr<ImageInfo>> m_imageInfoCache; 300 Vector<RefPtr<ImageInfo>> m_imageInfoCache;
301 #endif // USE_IOSURFACE_FOR_2D_CANVAS 301 #endif // USE_IOSURFACE_FOR_2D_CANVAS
302 }; 302 };
303 303
304 } // namespace blink 304 } // namespace blink
305 305
306 #endif 306 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698