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

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

Issue 2115493004: Make sure RecordingImageBufferSurface's current frame is valid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef RecordingImageBufferSurface_h 5 #ifndef RecordingImageBufferSurface_h
6 #define RecordingImageBufferSurface_h 6 #define RecordingImageBufferSurface_h
7 7
8 #include "platform/graphics/GraphicsContext.h" 8 #include "platform/graphics/GraphicsContext.h"
9 #include "platform/graphics/ImageBufferSurface.h" 9 #include "platform/graphics/ImageBufferSurface.h"
10 #include "public/platform/WebThread.h" 10 #include "public/platform/WebThread.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 FallbackReasonExpensiveOverdrawHeuristic = 14, 84 FallbackReasonExpensiveOverdrawHeuristic = 14,
85 FallbackReasonTextureBackedPattern = 15, 85 FallbackReasonTextureBackedPattern = 15,
86 FallbackReasonDrawImageOfVideo = 16, 86 FallbackReasonDrawImageOfVideo = 16,
87 FallbackReasonDrawImageOfAnimated2dCanvas = 17, 87 FallbackReasonDrawImageOfAnimated2dCanvas = 17,
88 FallbackReasonSubPixelTextAntiAliasingSupport = 18, 88 FallbackReasonSubPixelTextAntiAliasingSupport = 18,
89 FallbackReasonDrawImageWithTextureBackedSourceImage = 19, 89 FallbackReasonDrawImageWithTextureBackedSourceImage = 19,
90 FallbackReasonSnapshotForTransferToImageBitmap = 20, 90 FallbackReasonSnapshotForTransferToImageBitmap = 20,
91 FallbackReasonSnapshotForUnitTests = 21, // This value should never appe ar in production histograms 91 FallbackReasonSnapshotForUnitTests = 21, // This value should never appe ar in production histograms
92 FallbackReasonSnapshotGetCopiedImage = 22, 92 FallbackReasonSnapshotGetCopiedImage = 22,
93 FallbackReasonSnapshotWebGLDrawImageIntoBuffer = 23, 93 FallbackReasonSnapshotWebGLDrawImageIntoBuffer = 23,
94 FallbackReasonCurrentFrameNull = 24,
94 FallbackReasonCount, 95 FallbackReasonCount,
95 }; 96 };
96 private: 97 private:
97 friend class RecordingImageBufferSurfaceTest; // for unit testing 98 friend class RecordingImageBufferSurfaceTest; // for unit testing
98 void fallBackToRasterCanvas(FallbackReason); 99 void fallBackToRasterCanvas(FallbackReason);
99 void initializeCurrentFrame(); 100 void initializeCurrentFrame();
100 bool finalizeFrameInternal(FallbackReason*); 101 bool finalizeFrameInternal(FallbackReason*);
101 int approximateOpCount(); 102 int approximateOpCount();
102 103
103 std::unique_ptr<SkPictureRecorder> m_currentFrame; 104 std::unique_ptr<SkPictureRecorder> m_currentFrame;
104 RefPtr<SkPicture> m_previousFrame; 105 RefPtr<SkPicture> m_previousFrame;
105 std::unique_ptr<ImageBufferSurface> m_fallbackSurface; 106 std::unique_ptr<ImageBufferSurface> m_fallbackSurface;
106 ImageBuffer* m_imageBuffer; 107 ImageBuffer* m_imageBuffer;
107 int m_initialSaveCount; 108 int m_initialSaveCount;
108 int m_currentFramePixelCount; 109 int m_currentFramePixelCount;
109 int m_previousFramePixelCount; 110 int m_previousFramePixelCount;
110 bool m_frameWasCleared; 111 bool m_frameWasCleared;
111 bool m_didRecordDrawCommandsInCurrentFrame; 112 bool m_didRecordDrawCommandsInCurrentFrame;
112 bool m_currentFrameHasExpensiveOp; 113 bool m_currentFrameHasExpensiveOp;
113 bool m_previousFrameHasExpensiveOp; 114 bool m_previousFrameHasExpensiveOp;
114 std::unique_ptr<RecordingImageBufferFallbackSurfaceFactory> m_fallbackFactor y; 115 std::unique_ptr<RecordingImageBufferFallbackSurfaceFactory> m_fallbackFactor y;
115 }; 116 };
116 117
117 } // namespace blink 118 } // namespace blink
118 119
119 #endif 120 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698