| Differences between
and this patch
- a/Source/WebCore/ChangeLog +35 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2012-08-29  Dana Jansens  <danakj@chromium.org>
2
3
        [chromium] Add a copy() method to CCDrawQuad and CCSharedQuadState
4
        https://bugs.webkit.org/show_bug.cgi?id=95374
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        The ubercomp layer will hold a RenderPass full of DrawQuads, and needs
9
        to add quads to the current frame in appendQuads(). It will do this by
10
        copying the quads it has in its RenderPass into the frame's RenderPass.
11
12
        These methods allows it to make a clone of its quads.
13
14
        Test: CCDrawQuadTest.copySharedQuadState
15
              CCDrawQuadTest.copyCheckerboardDrawQuad
16
              CCDrawQuadTest.copyDebugBorderDrawQuad
17
              CCDrawQuadTest.copyIOSurfaceDrawQuad
18
              CCDrawQuadTest.copyRenderPassDrawQuad
19
              CCDrawQuadTest.copySolidColorDrawQuad
20
              CCDrawQuadTest.copyStreamVideoDrawQuad
21
              CCDrawQuadTest.copyTextureDrawQuad
22
              CCDrawQuadTest.copyTileDrawQuadcopy
23
              CCDrawQuadTest.copyYUVVideoDrawQuad
24
25
        * platform/graphics/chromium/cc/CCDrawQuad.cpp:
26
        (WebCore::CCDrawQuad::copy):
27
        (WebCore):
28
        * platform/graphics/chromium/cc/CCDrawQuad.h:
29
        (CCDrawQuad):
30
        * platform/graphics/chromium/cc/CCSharedQuadState.cpp:
31
        (WebCore::CCSharedQuadState::copy):
32
        (WebCore):
33
        * platform/graphics/chromium/cc/CCSharedQuadState.h:
34
        (CCSharedQuadState):
35
1
2012-08-29  Vsevolod Vlasov  <vsevik@chromium.org>
36
2012-08-29  Vsevolod Vlasov  <vsevik@chromium.org>
2
37
3
        Web Inspector: Extract StylesSourceMapping from StylesUISourceCodeProvider.
38
        Web Inspector: Extract StylesSourceMapping from StylesUISourceCodeProvider.
- a/Source/WebKit/chromium/ChangeLog +13 lines
Lines 1-3 a/Source/WebKit/chromium/ChangeLog_sec1
1
2012-08-29  Dana Jansens  <danakj@chromium.org>
2
3
        [chromium] Add a copy() method to CCDrawQuad and CCSharedQuadState
4
        https://bugs.webkit.org/show_bug.cgi?id=95374
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * WebKit.gypi:
9
        * tests/CCDrawQuadTest.cpp: Added.
10
        (TEST):
11
        (createSharedQuadState):
12
        (compareDrawQuad):
13
1
2012-08-29  Peter Beverloo  <peter@chromium.org>
14
2012-08-29  Peter Beverloo  <peter@chromium.org>
2
15
3
        Unreviewed.  Rolled DEPS.
16
        Unreviewed.  Rolled DEPS.
- a/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.cpp +12 lines
Lines 97-102 unsigned CCDrawQuad::size() const a/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.cpp_sec1
97
    return sizeof(CCDrawQuad);
97
    return sizeof(CCDrawQuad);
98
}
98
}
99
99
100
PassOwnPtr<CCDrawQuad> CCDrawQuad::copy(const CCSharedQuadState* copiedSharedQuadState) const
101
{
102
    unsigned bytes = size();
103
    ASSERT(bytes);
104
105
    OwnPtr<CCDrawQuad> copyQuad(adoptPtr(reinterpret_cast<CCDrawQuad*>(new char[bytes])));
106
    memcpy(copyQuad.get(), this, bytes);
107
    copyQuad->setSharedQuadState(copiedSharedQuadState);
108
109
    return copyQuad.release();
110
}
111
100
void CCDrawQuad::setSharedQuadState(const CCSharedQuadState* sharedQuadState)
112
void CCDrawQuad::setSharedQuadState(const CCSharedQuadState* sharedQuadState)
101
{
113
{
102
    m_sharedQuadState = sharedQuadState;
114
    m_sharedQuadState = sharedQuadState;
- a/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.h +2 lines
Lines 80-85 public: a/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.h_sec1
80
    // looking at the material type).
80
    // looking at the material type).
81
    unsigned size() const;
81
    unsigned size() const;
82
82
83
    PassOwnPtr<CCDrawQuad> copy(const CCSharedQuadState* copiedSharedQuadState) const;
84
83
    const CCSharedQuadState* sharedQuadState() const { return m_sharedQuadState; }
85
    const CCSharedQuadState* sharedQuadState() const { return m_sharedQuadState; }
84
    int sharedQuadStateId() const { return m_sharedQuadStateId; }
86
    int sharedQuadStateId() const { return m_sharedQuadStateId; }
85
    void setSharedQuadState(const CCSharedQuadState*);
87
    void setSharedQuadState(const CCSharedQuadState*);
- a/Source/WebCore/platform/graphics/chromium/cc/CCSharedQuadState.cpp +7 lines
Lines 46-49 CCSharedQuadState::CCSharedQuadState(const WebKit::WebTransformationMatrix& quad a/Source/WebCore/platform/graphics/chromium/cc/CCSharedQuadState.cpp_sec1
46
{
46
{
47
}
47
}
48
48
49
PassOwnPtr<CCSharedQuadState> CCSharedQuadState::copy() const
50
{
51
    OwnPtr<CCSharedQuadState> copiedState(create(quadTransform, visibleContentRect, clippedRectInTarget, opacity, opaque));
52
    copiedState->id = id;
53
    return copiedState.release();
54
}
55
49
}
56
}
- a/Source/WebCore/platform/graphics/chromium/cc/CCSharedQuadState.h -1 / +2 lines
Lines 45-51 struct CCSharedQuadState { a/Source/WebCore/platform/graphics/chromium/cc/CCSharedQuadState.h_sec1
45
45
46
    static PassOwnPtr<CCSharedQuadState> create(const WebKit::WebTransformationMatrix& quadTransform, const IntRect& visibleContentRect, const IntRect& clippedRectInTarget, float opacity, bool opaque);
46
    static PassOwnPtr<CCSharedQuadState> create(const WebKit::WebTransformationMatrix& quadTransform, const IntRect& visibleContentRect, const IntRect& clippedRectInTarget, float opacity, bool opaque);
47
    CCSharedQuadState(const WebKit::WebTransformationMatrix& quadTransform, const IntRect& visibleContentRect, const IntRect& clippedRectInTarget, float opacity, bool opaque);
47
    CCSharedQuadState(const WebKit::WebTransformationMatrix& quadTransform, const IntRect& visibleContentRect, const IntRect& clippedRectInTarget, float opacity, bool opaque);
48
    bool isLayerAxisAlignedIntRect() const;
48
49
    PassOwnPtr<CCSharedQuadState> copy() const;
49
};
50
};
50
51
51
}
52
}
- a/Source/WebKit/chromium/WebKit.gypi +1 lines
Lines 62-67 a/Source/WebKit/chromium/WebKit.gypi_sec1
62
            'tests/CCAnimationTestCommon.h',
62
            'tests/CCAnimationTestCommon.h',
63
            'tests/CCDamageTrackerTest.cpp',
63
            'tests/CCDamageTrackerTest.cpp',
64
            'tests/CCDelayBasedTimeSourceTest.cpp',
64
            'tests/CCDelayBasedTimeSourceTest.cpp',
65
            'tests/CCDrawQuadTest.cpp',
65
            'tests/CCFrameRateControllerTest.cpp',
66
            'tests/CCFrameRateControllerTest.cpp',
66
            'tests/CCKeyframedAnimationCurveTest.cpp',
67
            'tests/CCKeyframedAnimationCurveTest.cpp',
67
            'tests/CCLayerAnimationControllerTest.cpp',
68
            'tests/CCLayerAnimationControllerTest.cpp',
- a/Source/WebKit/chromium/tests/CCDrawQuadTest.cpp +319 lines
Line 0 a/Source/WebKit/chromium/tests/CCDrawQuadTest.cpp_sec1
1
/*
2
 * Copyright (C) 2012 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1.  Redistributions of source code must retain the above copyright
8
 *     notice, this list of conditions and the following disclaimer.
9
 * 2.  Redistributions in binary form must reproduce the above copyright
10
 *     notice, this list of conditions and the following disclaimer in the
11
 *     documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16
 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
17
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
 */
24
25
#include "config.h"
26
27
#include "CCDrawQuad.h"
28
29
#include "CCCheckerboardDrawQuad.h"
30
#include "CCDebugBorderDrawQuad.h"
31
#include "CCIOSurfaceDrawQuad.h"
32
#include "CCLayerTreeTestCommon.h"
33
#include "CCRenderPassDrawQuad.h"
34
#include "CCSolidColorDrawQuad.h"
35
#include "CCStreamVideoDrawQuad.h"
36
#include "CCTextureDrawQuad.h"
37
#include "CCTileDrawQuad.h"
38
#include "CCYUVVideoDrawQuad.h"
39
#include <gtest/gtest.h>
40
#include <public/WebTransformationMatrix.h>
41
42
using WebKit::WebTransformationMatrix;
43
44
using namespace WebCore;
45
46
namespace {
47
48
TEST(CCDrawQuadTest, copySharedQuadState)
49
{
50
    WebTransformationMatrix quadTransform(1, 0.5, 0, 1, 0.5, 0);
51
    IntRect visibleContentRect(10, 12, 14, 16);
52
    IntRect clippedRectInTarget(19, 21, 23, 25);
53
    float opacity = 0.25;
54
    bool opaque = true;
55
    int id = 3;
56
57
    OwnPtr<CCSharedQuadState> state(CCSharedQuadState::create(quadTransform, visibleContentRect, clippedRectInTarget, opacity, opaque));
58
    state->id = id;
59
60
    OwnPtr<CCSharedQuadState> copy(state->copy());
61
    EXPECT_EQ(id, copy->id);
62
    EXPECT_EQ(quadTransform, copy->quadTransform);
63
    EXPECT_INT_RECT_EQ(visibleContentRect, copy->visibleContentRect);
64
    EXPECT_INT_RECT_EQ(clippedRectInTarget, copy->clippedRectInTarget);
65
    EXPECT_EQ(opacity, copy->opacity);
66
    EXPECT_EQ(opaque, copy->opaque);
67
}
68
69
PassOwnPtr<CCSharedQuadState> createSharedQuadState()
70
{
71
    WebTransformationMatrix quadTransform(1, 0.5, 0, 1, 0.5, 0);
72
    IntRect visibleContentRect(10, 12, 14, 16);
73
    IntRect clippedRectInTarget(19, 21, 23, 25);
74
    float opacity = 1;
75
    bool opaque = false;
76
    int id = 3;
77
78
    OwnPtr<CCSharedQuadState> state(CCSharedQuadState::create(quadTransform, visibleContentRect, clippedRectInTarget, opacity, opaque));
79
    state->id = id;
80
    return state.release();
81
}
82
83
void compareDrawQuad(CCDrawQuad* quad, CCDrawQuad* copy, CCSharedQuadState* copySharedState)
84
{
85
    EXPECT_EQ(quad->size(), copy->size());
86
    EXPECT_EQ(quad->material(), copy->material());
87
    EXPECT_EQ(quad->isDebugQuad(), copy->isDebugQuad());
88
    EXPECT_INT_RECT_EQ(quad->quadRect(), copy->quadRect());
89
    EXPECT_INT_RECT_EQ(quad->quadVisibleRect(), copy->quadVisibleRect());
90
    EXPECT_EQ(quad->opaqueRect(), copy->opaqueRect());
91
    EXPECT_EQ(quad->needsBlending(), copy->needsBlending());
92
93
    EXPECT_EQ(copySharedState, copy->sharedQuadState());
94
    EXPECT_EQ(copySharedState->id, copy->sharedQuadStateId());
95
96
    EXPECT_EQ(quad->sharedQuadStateId(), quad->sharedQuadState()->id);
97
    EXPECT_EQ(copy->sharedQuadStateId(), copy->sharedQuadState()->id);
98
}
99
100
#define CREATE_SHARED_STATE() \
101
    OwnPtr<CCSharedQuadState> sharedState(createSharedQuadState()); \
102
    OwnPtr<CCSharedQuadState> copySharedState(sharedState->copy()); \
103
    copySharedState->id = 5;
104
105
#define QUAD_DATA \
106
    IntRect quadRect(30, 40, 50, 60); \
107
    IntRect quadVisibleRect(40, 50, 30, 20); \
108
109
#define SETUP_AND_COPY_QUAD(Type, quad) \
110
    quad->setQuadVisibleRect(quadVisibleRect); \
111
    OwnPtr<CCDrawQuad> copy(quad->copy(copySharedState.get())); \
112
    compareDrawQuad(quad.get(), copy.get(), copySharedState.get()); \
113
    const Type* copyQuad = Type::materialCast(copy.get());
114
115
#define CREATE_QUAD_0(Type) \
116
    QUAD_DATA \
117
    OwnPtr<Type> quad(Type::create(sharedState.get(), quadRect)); \
118
    SETUP_AND_COPY_QUAD(Type, quad); \
119
    UNUSED_PARAM(copyQuad);
120
121
#define CREATE_QUAD_1(Type, a) \
122
    QUAD_DATA \
123
    OwnPtr<Type> quad(Type::create(sharedState.get(), quadRect, a)); \
124
    SETUP_AND_COPY_QUAD(Type, quad);
125
126
#define CREATE_QUAD_2(Type, a, b) \
127
    QUAD_DATA \
128
    OwnPtr<Type> quad(Type::create(sharedState.get(), quadRect, a, b)); \
129
    SETUP_AND_COPY_QUAD(Type, quad);
130
131
#define CREATE_QUAD_3(Type, a, b, c) \
132
    QUAD_DATA \
133
    OwnPtr<Type> quad(Type::create(sharedState.get(), quadRect, a, b, c)); \
134
    SETUP_AND_COPY_QUAD(Type, quad);
135
136
#define CREATE_QUAD_4(Type, a, b, c, d) \
137
    QUAD_DATA \
138
    OwnPtr<Type> quad(Type::create(sharedState.get(), quadRect, a, b, c, d)); \
139
    SETUP_AND_COPY_QUAD(Type, quad);
140
141
#define CREATE_QUAD_5(Type, a, b, c, d, e) \
142
    QUAD_DATA \
143
    OwnPtr<Type> quad(Type::create(sharedState.get(), quadRect, a, b, c, d, e)); \
144
    SETUP_AND_COPY_QUAD(Type, quad);
145
146
#define CREATE_QUAD_6(Type, a, b, c, d, e, f) \
147
    QUAD_DATA \
148
    OwnPtr<Type> quad(Type::create(sharedState.get(), quadRect, a, b, c, d, e, f)); \
149
    SETUP_AND_COPY_QUAD(Type, quad);
150
151
#define CREATE_QUAD_7(Type, a, b, c, d, e, f, g) \
152
    QUAD_DATA \
153
    OwnPtr<Type> quad(Type::create(sharedState.get(), quadRect, a, b, c, d, e, f, g)); \
154
    SETUP_AND_COPY_QUAD(Type, quad);
155
156
#define CREATE_QUAD_8(Type, a, b, c, d, e, f, g, h) \
157
    QUAD_DATA \
158
    OwnPtr<Type> quad(Type::create(sharedState.get(), quadRect, a, b, c, d, e, f, g, h)); \
159
    SETUP_AND_COPY_QUAD(Type, quad);
160
161
#define CREATE_QUAD_9(Type, a, b, c, d, e, f, g, h, i) \
162
    QUAD_DATA \
163
    OwnPtr<Type> quad(Type::create(sharedState.get(), quadRect, a, b, c, d, e, f, g, h, i)); \
164
    SETUP_AND_COPY_QUAD(Type, quad);
165
166
#define CREATE_QUAD_10(Type, a, b, c, d, e, f, g, h, i, j) \
167
    QUAD_DATA \
168
    OwnPtr<Type> quad(Type::create(sharedState.get(), quadRect, a, b, c, d, e, f, g, h, i, j)); \
169
    SETUP_AND_COPY_QUAD(Type, quad);
170
171
TEST(CCDrawQuadTest, copyCheckerboardDrawQuad)
172
{
173
    CREATE_SHARED_STATE();
174
    CREATE_QUAD_0(CCCheckerboardDrawQuad);
175
}
176
177
TEST(CCDrawQuadTest, copyDebugBorderDrawQuad)
178
{
179
    SkColor color = 0xfabb0011;
180
    int width = 99;
181
    CREATE_SHARED_STATE();
182
    CREATE_QUAD_2(CCDebugBorderDrawQuad, color, width);
183
    EXPECT_EQ(color, copyQuad->color());
184
    EXPECT_EQ(width, copyQuad->width());
185
}
186
187
TEST(CCDrawQuadTest, copyIOSurfaceDrawQuad)
188
{
189
    IntSize size(58, 95);
190
    unsigned textureId = 72;
191
    CCIOSurfaceDrawQuad::Orientation orientation = CCIOSurfaceDrawQuad::Unflipped;
192
193
    CREATE_SHARED_STATE();
194
    CREATE_QUAD_3(CCIOSurfaceDrawQuad, size, textureId, orientation);
195
    EXPECT_EQ(size, copyQuad->ioSurfaceSize());
196
    EXPECT_EQ(textureId, copyQuad->ioSurfaceTextureId());
197
    EXPECT_EQ(orientation, copyQuad->orientation());
198
}
199
200
TEST(CCDrawQuadTest, copyRenderPassDrawQuad)
201
{
202
    int renderPassId = 22;
203
    bool isReplica = true;
204
    CCResourceProvider::ResourceId maskResourceId = 78;
205
    IntRect contentsChangedSinceLastFrame(42, 11, 74, 24);
206
    float maskTexCoordScaleX = 33;
207
    float maskTexCoordScaleY = 19;
208
    float maskTexCoordOffsetX = -45;
209
    float maskTexCoordOffsetY = -21;
210
211
    CREATE_SHARED_STATE();
212
    CREATE_QUAD_8(CCRenderPassDrawQuad, renderPassId, isReplica, maskResourceId, contentsChangedSinceLastFrame, maskTexCoordScaleX, maskTexCoordScaleY, maskTexCoordOffsetX, maskTexCoordOffsetY);
213
    EXPECT_EQ(renderPassId, copyQuad->renderPassId());
214
    EXPECT_EQ(isReplica, copyQuad->isReplica());
215
    EXPECT_EQ(maskResourceId, copyQuad->maskResourceId());
216
    EXPECT_INT_RECT_EQ(contentsChangedSinceLastFrame, copyQuad->contentsChangedSinceLastFrame());
217
    EXPECT_EQ(maskTexCoordScaleX, copyQuad->maskTexCoordScaleX());
218
    EXPECT_EQ(maskTexCoordScaleY, copyQuad->maskTexCoordScaleY());
219
    EXPECT_EQ(maskTexCoordOffsetX, copyQuad->maskTexCoordOffsetX());
220
    EXPECT_EQ(maskTexCoordOffsetY, copyQuad->maskTexCoordOffsetY());   
221
}
222
223
TEST(CCDrawQuadTest, copySolidColorDrawQuad)
224
{
225
    SkColor color = 0x49494949;
226
227
    CREATE_SHARED_STATE();
228
    CREATE_QUAD_1(CCSolidColorDrawQuad, color);
229
    EXPECT_EQ(color, copyQuad->color());
230
}
231
232
TEST(CCDrawQuadTest, copyStreamVideoDrawQuad)
233
{
234
    unsigned textureId = 64;
235
    WebTransformationMatrix matrix(0.5, 1, 0.25, 0.75, 0, 1);
236
237
    CREATE_SHARED_STATE();
238
    CREATE_QUAD_2(CCStreamVideoDrawQuad, textureId, matrix);
239
    EXPECT_EQ(textureId, copyQuad->textureId());
240
    EXPECT_EQ(matrix, copyQuad->matrix());
241
}
242
243
TEST(CCDrawQuadTest, copyTextureDrawQuad)
244
{
245
    unsigned resourceId = 82;
246
    bool premultipliedAlpha = true;
247
    FloatRect uvRect(0.5, 224, -51, 36);
248
    bool flipped = true;
249
250
    CREATE_SHARED_STATE();
251
    CREATE_QUAD_4(CCTextureDrawQuad, resourceId, premultipliedAlpha, uvRect, flipped);
252
    EXPECT_EQ(resourceId, copyQuad->resourceId());
253
    EXPECT_EQ(premultipliedAlpha, copyQuad->premultipliedAlpha());
254
    EXPECT_EQ(uvRect, copyQuad->uvRect());
255
    EXPECT_EQ(flipped, copyQuad->flipped());
256
}
257
258
TEST(CCDrawQuadTest, copyTileDrawQuad)
259
{
260
    IntRect opaqueRect(33, 44, 22, 33);
261
    unsigned resourceId = 104;
262
    IntPoint textureOffset(-31, 47);
263
    IntSize textureSize(85, 32);
264
    GC3Dint textureFilter = 82;
265
    bool swizzleContents = true;
266
    bool leftEdgeAA = true;
267
    bool topEdgeAA = true;
268
    bool rightEdgeAA = false;
269
    bool bottomEdgeAA = true;
270
271
    CREATE_SHARED_STATE();
272
    CREATE_QUAD_10(CCTileDrawQuad, opaqueRect, resourceId, textureOffset, textureSize, textureFilter, swizzleContents, leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA);
273
    EXPECT_INT_RECT_EQ(opaqueRect, copyQuad->opaqueRect());
274
    EXPECT_EQ(resourceId, copyQuad->resourceId());
275
    EXPECT_EQ(textureOffset, copyQuad->textureOffset());
276
    EXPECT_EQ(textureSize, copyQuad->textureSize());
277
    EXPECT_EQ(textureFilter, copyQuad->textureFilter());
278
    EXPECT_EQ(swizzleContents, copyQuad->swizzleContents());
279
    EXPECT_EQ(leftEdgeAA, copyQuad->leftEdgeAA());
280
    EXPECT_EQ(topEdgeAA, copyQuad->topEdgeAA());
281
    EXPECT_EQ(rightEdgeAA, copyQuad->rightEdgeAA());
282
    EXPECT_EQ(bottomEdgeAA, copyQuad->bottomEdgeAA());
283
}
284
285
TEST(CCDrawQuadTest, copyYUVVideoDrawQuad)
286
{
287
    CCVideoLayerImpl::FramePlane yPlane;
288
    yPlane.resourceId = 45;
289
    yPlane.size = IntSize(34, 23);
290
    yPlane.format = 8;
291
    yPlane.visibleSize = IntSize(623, 235);
292
    CCVideoLayerImpl::FramePlane uPlane;
293
    uPlane.resourceId = 532;
294
    uPlane.size = IntSize(134, 16);
295
    uPlane.format = 2;
296
    uPlane.visibleSize = IntSize(126, 27);
297
    CCVideoLayerImpl::FramePlane vPlane;
298
    vPlane.resourceId = 4;
299
    vPlane.size = IntSize(456, 486);
300
    vPlane.format = 46;
301
    vPlane.visibleSize = IntSize(19, 45);
302
303
    CREATE_SHARED_STATE();
304
    CREATE_QUAD_3(CCYUVVideoDrawQuad, yPlane, uPlane, vPlane);
305
    EXPECT_EQ(yPlane.resourceId, copyQuad->yPlane().resourceId);
306
    EXPECT_EQ(yPlane.size, copyQuad->yPlane().size);
307
    EXPECT_EQ(yPlane.format, copyQuad->yPlane().format);
308
    EXPECT_EQ(yPlane.visibleSize, copyQuad->yPlane().visibleSize);
309
    EXPECT_EQ(uPlane.resourceId, copyQuad->uPlane().resourceId);
310
    EXPECT_EQ(uPlane.size, copyQuad->uPlane().size);
311
    EXPECT_EQ(uPlane.format, copyQuad->uPlane().format);
312
    EXPECT_EQ(uPlane.visibleSize, copyQuad->uPlane().visibleSize);
313
    EXPECT_EQ(vPlane.resourceId, copyQuad->vPlane().resourceId);
314
    EXPECT_EQ(vPlane.size, copyQuad->vPlane().size);
315
    EXPECT_EQ(vPlane.format, copyQuad->vPlane().format);
316
    EXPECT_EQ(vPlane.visibleSize, copyQuad->vPlane().visibleSize);
317
}
318
319
} // namespace

Return to Bug 95374