forked from weolar/miniblink49
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDisplayListRecordingSource.cpp
61 lines (52 loc) · 1.88 KB
/
DisplayListRecordingSource.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "cc/playback/DisplayListRecordingSource.h"
namespace cc {
void DisplayListRecordingSource::invalidate(const IntRect& dirtyRect)
{
IntRect inval = dirtyRect;
inval.intersect(IntRect(0, 0, m_size.width(), m_size.height()));
if (inval.isEmpty())
return;
// TODO: Support multiple non-intersecting webkit invals
if (m_dirtyRects.size())
m_dirtyRects[0].unite(inval);
else
m_dirtyRects.append(inval);
}
void DisplayListRecordingSource::setSize(const IntSize& size)
{
;
}
void DisplayListRecordingSource::applyDirtyRects(TileGrid* tileGrid, const IntRect& screenRect)
{
// TODO ºÏ²¢Ôà¾ØÐÎ
Vector<IntRect> m_dirtyRects;
for (size_t i = 0; i < m_dirtyRects.size(); ++i) {
IntRect dirtyRect = m_dirtyRects[i];
Vector<Tile*>& tiles = tileGrid->tiles();
for (size_t j = 0; j < tiles.size(); ++j) {
Tile* tile = tiles[i];
blink::IntRect tilePos = tile->postion();
if (!tilePos.intersects(dirtyRect))
continue;
blink::IntRect dirtyRectInTile = tilePos;
dirtyRectInTile.intersect(dirtyRect);
tile->setDirtyRect(dirtyRectInTile);
if (TileGrid::isInWillBeShowedArea(tile, screenRect)) {
// ·¢È¥¹âÕ¤»¯;
}
}
}
}
void DisplayListRecordingSource::updateRecordingSource(WebLayerImplClient* client, RecordingSourceContainer& recordingSourceContainer)
{
}
void DisplayListRecordingSource::updateRecordingSourcesIfNeeded(WebLayerImplClient* client)
{
applyDirtyRects();
for (size_t i = 0; i < m_recordingSourcePile.size(); i++) {
RecordingSourceContainer& recordingSourceContainer = m_recordingSourcePile[i];
if (recordingSourceContainer.dirty)
updateRecordingSource(client, recordingSourceContainer);
}
}
} // cc