Changeset 122180 in webkit


Ignore:
Timestamp:
Jul 9, 2012 6:43:31 PM (12 years ago)
Author:
danakj@chromium.org
Message:

[chromium] Create CCScopedTexture class for creating/freeing textures
https://bugs.webkit.org/show_bug.cgi?id=89485

Reviewed by Adrienne Walker.

Source/WebCore:

This class provides a standard way to create texture ids in a way that
ensures they will be freed later.

Also includes a CCTexture base class that holds textureId, size, and
format together in a struct that can be used in place of storing an
unsigned textureId in other classes.

Unit tests: CCScopedTexureTest.NewScopedTexture

CCScopedTexureTest.CreateScopedTexture
CCScopedTexureTest.ScopedTextureIsDeleted
CCScopedTexureTest.LoseScopedTexture

  • WebCore.gypi:
  • platform/graphics/chromium/cc/CCScopedTexture.cpp: Added.

(WebCore):
(WebCore::CCScopedTexture::CCScopedTexture):
(WebCore::CCScopedTexture::~CCScopedTexture):
(WebCore::CCScopedTexture::allocate):
(WebCore::CCScopedTexture::free):
(WebCore::CCScopedTexture::leak):

  • platform/graphics/chromium/cc/CCScopedTexture.h: Added.

(WebCore):
(CCScopedTexture):
(WebCore::CCScopedTexture::create):

  • platform/graphics/chromium/cc/CCTexture.cpp: Added.

(WebCore):
(WebCore::CCTexture::setDimensions):
(WebCore::CCTexture::bytes):
(WebCore::CCTexture::memorySizeBytes):

  • platform/graphics/chromium/cc/CCTexture.h: Added.

(WebCore):
(CCTexture):
(WebCore::CCTexture::CCTexture):
(WebCore::CCTexture::id):
(WebCore::CCTexture::size):
(WebCore::CCTexture::format):
(WebCore::CCTexture::setId):

Source/WebKit/chromium:

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

(WebKitTests):
(WebKitTests::TEST):
(TrackingTextureAllocator):
(WebKitTests::TrackingTextureAllocator::TrackingTextureAllocator):
(WebKitTests::TrackingTextureAllocator::numTextures):

Location:
trunk/Source
Files:
5 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r122179 r122180  
     12012-07-09  Dana Jansens  <danakj@chromium.org>
     2
     3        [chromium] Create CCScopedTexture class for creating/freeing textures
     4        https://bugs.webkit.org/show_bug.cgi?id=89485
     5
     6        Reviewed by Adrienne Walker.
     7
     8        This class provides a standard way to create texture ids in a way that
     9        ensures they will be freed later.
     10
     11        Also includes a CCTexture base class that holds textureId, size, and
     12        format together in a struct that can be used in place of storing an
     13        unsigned textureId in other classes.
     14
     15        Unit tests: CCScopedTexureTest.NewScopedTexture
     16                    CCScopedTexureTest.CreateScopedTexture
     17                    CCScopedTexureTest.ScopedTextureIsDeleted
     18                    CCScopedTexureTest.LoseScopedTexture
     19
     20        * WebCore.gypi:
     21        * platform/graphics/chromium/cc/CCScopedTexture.cpp: Added.
     22        (WebCore):
     23        (WebCore::CCScopedTexture::CCScopedTexture):
     24        (WebCore::CCScopedTexture::~CCScopedTexture):
     25        (WebCore::CCScopedTexture::allocate):
     26        (WebCore::CCScopedTexture::free):
     27        (WebCore::CCScopedTexture::leak):
     28        * platform/graphics/chromium/cc/CCScopedTexture.h: Added.
     29        (WebCore):
     30        (CCScopedTexture):
     31        (WebCore::CCScopedTexture::create):
     32        * platform/graphics/chromium/cc/CCTexture.cpp: Added.
     33        (WebCore):
     34        (WebCore::CCTexture::setDimensions):
     35        (WebCore::CCTexture::bytes):
     36        (WebCore::CCTexture::memorySizeBytes):
     37        * platform/graphics/chromium/cc/CCTexture.h: Added.
     38        (WebCore):
     39        (CCTexture):
     40        (WebCore::CCTexture::CCTexture):
     41        (WebCore::CCTexture::id):
     42        (WebCore::CCTexture::size):
     43        (WebCore::CCTexture::format):
     44        (WebCore::CCTexture::setId):
     45
    1462012-07-09  Joshua Bell  <jsbell@chromium.org>
    247
  • trunk/Source/WebCore/WebCore.gypi

    r122159 r122180  
    83628362            'platform/graphics/chromium/cc/CCSchedulerStateMachine.cpp',
    83638363            'platform/graphics/chromium/cc/CCSchedulerStateMachine.h',
     8364            'platform/graphics/chromium/cc/CCScopedTexture.cpp',
     8365            'platform/graphics/chromium/cc/CCScopedTexture.h',
    83648366            'platform/graphics/chromium/cc/CCScopedThreadProxy.h',
    83658367            'platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp',
     
    83778379            'platform/graphics/chromium/cc/CCStreamVideoDrawQuad.cpp',
    83788380            'platform/graphics/chromium/cc/CCStreamVideoDrawQuad.h',
     8381            'platform/graphics/chromium/cc/CCTexture.cpp',
     8382            'platform/graphics/chromium/cc/CCTexture.h',
    83798383            'platform/graphics/chromium/cc/CCTextureDrawQuad.cpp',
    83808384            'platform/graphics/chromium/cc/CCTextureDrawQuad.h',
  • trunk/Source/WebKit/chromium/ChangeLog

    r122172 r122180  
     12012-07-09  Dana Jansens  <danakj@chromium.org>
     2
     3        [chromium] Create CCScopedTexture class for creating/freeing textures
     4        https://bugs.webkit.org/show_bug.cgi?id=89485
     5
     6        Reviewed by Adrienne Walker.
     7
     8        * WebKit.gypi:
     9        * tests/CCScopedTextureTest.cpp: Added.
     10        (WebKitTests):
     11        (WebKitTests::TEST):
     12        (TrackingTextureAllocator):
     13        (WebKitTests::TrackingTextureAllocator::TrackingTextureAllocator):
     14        (WebKitTests::TrackingTextureAllocator::numTextures):
     15
    1162012-07-09  Joshua Bell  <jsbell@chromium.org>
    217
  • trunk/Source/WebKit/chromium/WebKit.gypi

    r122171 r122180  
    8787            'tests/CCSchedulerTestCommon.h',
    8888            'tests/CCSchedulerTest.cpp',
     89            'tests/CCScopedTextureTest.cpp',
    8990            'tests/CCSolidColorLayerImplTest.cpp',
    9091            'tests/CCTestCommon.h',
Note: See TracChangeset for help on using the changeset viewer.