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

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

Issue 2077413005: Add "alpha" option to PaintWorklet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 4 years, 6 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 #include "platform/graphics/RecordingImageBufferSurface.h" 5 #include "platform/graphics/RecordingImageBufferSurface.h"
6 6
7 #include "platform/Histogram.h" 7 #include "platform/Histogram.h"
8 #include "platform/graphics/CanvasMetrics.h" 8 #include "platform/graphics/CanvasMetrics.h"
9 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" 9 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h"
10 #include "platform/graphics/GraphicsContext.h" 10 #include "platform/graphics/GraphicsContext.h"
(...skipping 11 matching lines...) Expand all
22 , m_imageBuffer(0) 22 , m_imageBuffer(0)
23 , m_currentFramePixelCount(0) 23 , m_currentFramePixelCount(0)
24 , m_previousFramePixelCount(0) 24 , m_previousFramePixelCount(0)
25 , m_frameWasCleared(true) 25 , m_frameWasCleared(true)
26 , m_didRecordDrawCommandsInCurrentFrame(false) 26 , m_didRecordDrawCommandsInCurrentFrame(false)
27 , m_currentFrameHasExpensiveOp(false) 27 , m_currentFrameHasExpensiveOp(false)
28 , m_previousFrameHasExpensiveOp(false) 28 , m_previousFrameHasExpensiveOp(false)
29 , m_fallbackFactory(std::move(fallbackFactory)) 29 , m_fallbackFactory(std::move(fallbackFactory))
30 { 30 {
31 initializeCurrentFrame(); 31 initializeCurrentFrame();
32 clear();
ikilpatrick 2016/06/22 16:00:24 Why is this needed?
Gleb Lanbin 2016/06/22 21:23:45 clear() method is the one which actually sets the
32 } 33 }
33 34
34 RecordingImageBufferSurface::~RecordingImageBufferSurface() 35 RecordingImageBufferSurface::~RecordingImageBufferSurface()
35 { } 36 { }
36 37
37 void RecordingImageBufferSurface::initializeCurrentFrame() 38 void RecordingImageBufferSurface::initializeCurrentFrame()
38 { 39 {
39 static SkRTreeFactory rTreeFactory; 40 static SkRTreeFactory rTreeFactory;
40 m_currentFrame = wrapUnique(new SkPictureRecorder); 41 m_currentFrame = wrapUnique(new SkPictureRecorder);
41 m_currentFrame->beginRecording(size().width(), size().height(), &rTreeFactor y); 42 m_currentFrame->beginRecording(size().width(), size().height(), &rTreeFactor y);
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 349
349 void RecordingImageBufferSurface::setIsHidden(bool hidden) 350 void RecordingImageBufferSurface::setIsHidden(bool hidden)
350 { 351 {
351 if (m_fallbackSurface) 352 if (m_fallbackSurface)
352 m_fallbackSurface->setIsHidden(hidden); 353 m_fallbackSurface->setIsHidden(hidden);
353 else 354 else
354 ImageBufferSurface::setIsHidden(hidden); 355 ImageBufferSurface::setIsHidden(hidden);
355 } 356 }
356 357
357 } // namespace blink 358 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698