Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 140 | 140 |
| 141 void Paint(GraphicsContext&, const LayoutRect&); | 141 void Paint(GraphicsContext&, const LayoutRect&); |
| 142 | 142 |
| 143 PaintCanvas* DrawingCanvas() const; | 143 PaintCanvas* DrawingCanvas() const; |
| 144 void DisableDeferral(DisableDeferralReason) const; | 144 void DisableDeferral(DisableDeferralReason) const; |
| 145 PaintCanvas* ExistingDrawingCanvas() const; | 145 PaintCanvas* ExistingDrawingCanvas() const; |
| 146 | 146 |
| 147 CanvasRenderingContext* RenderingContext() const { return context_.Get(); } | 147 CanvasRenderingContext* RenderingContext() const { return context_.Get(); } |
| 148 | 148 |
| 149 void EnsureUnacceleratedImageBuffer(); | 149 void EnsureUnacceleratedImageBuffer(); |
| 150 ImageBuffer* Buffer() const; | |
| 151 PassRefPtr<Image> CopiedImage(SourceDrawingBuffer, | 150 PassRefPtr<Image> CopiedImage(SourceDrawingBuffer, |
| 152 AccelerationHint, | 151 AccelerationHint, |
| 153 SnapshotReason) const; | 152 SnapshotReason) const; |
| 154 void ClearCopiedImage(); | 153 void ClearCopiedImage(); |
| 155 | 154 |
| 156 bool OriginClean() const; | 155 bool OriginClean() const; |
| 157 void SetOriginTainted() { origin_clean_ = false; } | 156 void SetOriginTainted() { origin_clean_ = false; } |
| 158 | 157 |
| 159 AffineTransform BaseTransform() const; | 158 AffineTransform BaseTransform() const; |
| 160 | 159 |
| 161 bool Is3d() const; | 160 bool Is3d() const; |
| 162 bool Is2d() const; | 161 bool Is2d() const; |
| 163 bool IsAnimated2d() const; | 162 bool IsAnimated2d() const; |
| 164 | 163 |
| 165 bool HasImageBuffer() const { return image_buffer_.get(); } | 164 bool HasImageBuffer() const override { return !!image_buffer_; } |
| 166 void DiscardImageBuffer(); | 165 void DiscardImageBuffer() override; |
| 166 ImageBuffer* GetImageBuffer() const override; | |
|
Justin Novosad
2017/05/01 15:18:57
This should be called GetOrCreateImageBuffer() IMH
fserb
2017/05/02 18:49:30
done
| |
| 167 | 167 |
| 168 bool ShouldBeDirectComposited() const; | 168 bool ShouldBeDirectComposited() const; |
| 169 | 169 |
| 170 void PrepareSurfaceForPaintingIfNeeded() const; | 170 void PrepareSurfaceForPaintingIfNeeded() const; |
| 171 | 171 |
| 172 const AtomicString ImageSourceURL() const override; | 172 const AtomicString ImageSourceURL() const override; |
| 173 | 173 |
| 174 InsertionNotificationRequest InsertedInto(ContainerNode*) override; | 174 InsertionNotificationRequest InsertedInto(ContainerNode*) override; |
| 175 | 175 |
| 176 bool IsDirty() { return !dirty_rect_.IsEmpty(); } | 176 bool IsDirty() { return !dirty_rect_.IsEmpty(); } |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 336 std::unique_ptr<CanvasSurfaceLayerBridge> surface_layer_bridge_; | 336 std::unique_ptr<CanvasSurfaceLayerBridge> surface_layer_bridge_; |
| 337 | 337 |
| 338 int num_frames_since_last_rendering_mode_switch_; | 338 int num_frames_since_last_rendering_mode_switch_; |
| 339 bool pending_rendering_mode_switch_; | 339 bool pending_rendering_mode_switch_; |
| 340 bool did_notify_listeners_for_current_frame_ = false; | 340 bool did_notify_listeners_for_current_frame_ = false; |
| 341 }; | 341 }; |
| 342 | 342 |
| 343 } // namespace blink | 343 } // namespace blink |
| 344 | 344 |
| 345 #endif // HTMLCanvasElement_h | 345 #endif // HTMLCanvasElement_h |
| OLD | NEW |