Changeset 127699 in webkit


Ignore:
Timestamp:
Sep 5, 2012 11:26:51 PM (12 years ago)
Author:
danakj@chromium.org
Message:

[chromium] Add a copy() method to CCDrawQuad and CCSharedQuadState
https://bugs.webkit.org/show_bug.cgi?id=95374

Reviewed by Adrienne Walker.

Source/WebCore:

The ubercomp layer will hold a RenderPass full of DrawQuads, and needs
to add quads to the current frame in appendQuads(). It will do this by
copying the quads it has in its RenderPass into the frame's RenderPass.

These methods allows it to make a clone of its quads.

Test: CCDrawQuadTest.copySharedQuadState

CCDrawQuadTest.copyCheckerboardDrawQuad
CCDrawQuadTest.copyDebugBorderDrawQuad
CCDrawQuadTest.copyIOSurfaceDrawQuad
CCDrawQuadTest.copyRenderPassDrawQuad
CCDrawQuadTest.copySolidColorDrawQuad
CCDrawQuadTest.copyStreamVideoDrawQuad
CCDrawQuadTest.copyTextureDrawQuad
CCDrawQuadTest.copyTileDrawQuadcopy
CCDrawQuadTest.copyYUVVideoDrawQuad

  • platform/graphics/chromium/cc/CCDrawQuad.cpp:

(WebCore::CCDrawQuad::copy):
(WebCore):

  • platform/graphics/chromium/cc/CCDrawQuad.h:

(CCDrawQuad):

  • platform/graphics/chromium/cc/CCSharedQuadState.cpp:

(WebCore::CCSharedQuadState::copy):
(WebCore):

  • platform/graphics/chromium/cc/CCSharedQuadState.h:

(CCSharedQuadState):

Source/WebKit/chromium:

  • WebKit.gypi:
  • tests/CCDrawQuadTest.cpp: Added.

(TEST):
(createSharedQuadState):
(compareDrawQuad):

Location:
trunk/Source
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r127696 r127699  
     12012-09-05  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 Adrienne Walker.
     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
    1362012-09-05  Tim Horton  <timothy_horton@apple.com>
    237
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.cpp

    r125932 r127699  
    9898}
    9999
     100PassOwnPtr<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
    100112void CCDrawQuad::setSharedQuadState(const CCSharedQuadState* sharedQuadState)
    101113{
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.h

    r125932 r127699  
    8181    unsigned size() const;
    8282
     83    PassOwnPtr<CCDrawQuad> copy(const CCSharedQuadState* copiedSharedQuadState) const;
     84
    8385    const CCSharedQuadState* sharedQuadState() const { return m_sharedQuadState; }
    8486    int sharedQuadStateId() const { return m_sharedQuadStateId; }
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCSharedQuadState.cpp

    r126482 r127699  
    4747}
    4848
     49PassOwnPtr<CCSharedQuadState> CCSharedQuadState::copy() const
     50{
     51    OwnPtr<CCSharedQuadState> copiedState(create(quadTransform, visibleContentRect, clippedRectInTarget, opacity, opaque));
     52    copiedState->id = id;
     53    return copiedState.release();
    4954}
     55
     56}
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCSharedQuadState.h

    r126482 r127699  
    4646    static PassOwnPtr<CCSharedQuadState> create(const WebKit::WebTransformationMatrix& quadTransform, const IntRect& visibleContentRect, const IntRect& clippedRectInTarget, float opacity, bool opaque);
    4747    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;
    4950};
    5051
  • trunk/Source/WebKit/chromium/ChangeLog

    r127692 r127699  
     12012-09-05  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 Adrienne Walker.
     7
     8        * WebKit.gypi:
     9        * tests/CCDrawQuadTest.cpp: Added.
     10        (TEST):
     11        (createSharedQuadState):
     12        (compareDrawQuad):
     13
    1142012-09-05  Kenichi Ishibashi  <bashi@chromium.org>
    215
  • trunk/Source/WebKit/chromium/WebKit.gypi

    r127340 r127699  
    120120            'tests/CCDamageTrackerTest.cpp',
    121121            'tests/CCDelayBasedTimeSourceTest.cpp',
     122            'tests/CCDrawQuadTest.cpp',
    122123            'tests/CCFrameRateControllerTest.cpp',
    123124            'tests/CCGeometryTestUtils.cpp',
Note: See TracChangeset for help on using the changeset viewer.