Changeset 63944 in webkit


Ignore:
Timestamp:
Jul 22, 2010 7:55:21 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-07-22 Patrick Gansterer <paroga@paroga.com>

Reviewed by Adam Roben.

[WINCE] Add additonal methods to BitmapInfo.
https://bugs.webkit.org/show_bug.cgi?id=42071

Added a parameter to create 16bit BitmapInfo and
some additional accessors for the WinCE port.

Set bmiHeader.biSize only at constructor.

  • platform/win/BitmapInfo.cpp: Added property svn:eol-style. (WebCore::bitmapInfoForSize): (WebCore::BitmapInfo::create): (WebCore::BitmapInfo::createBottomUp):
  • platform/win/BitmapInfo.h: Added property svn:eol-style. (WebCore::BitmapInfo::is16bit): (WebCore::BitmapInfo::is32bit): (WebCore::BitmapInfo::width): (WebCore::BitmapInfo::height): (WebCore::BitmapInfo::size): (WebCore::BitmapInfo::paddedWidth): (WebCore::BitmapInfo::numPixels): (WebCore::BitmapInfo::paddedBytesPerLine): (WebCore::BitmapInfo::bytesPerLine):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r63943 r63944  
     12010-07-22  Patrick Gansterer  <paroga@paroga.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        [WINCE] Add additonal methods to BitmapInfo.
     6        https://bugs.webkit.org/show_bug.cgi?id=42071
     7
     8        Added a parameter to create 16bit BitmapInfo and
     9        some additional accessors for the WinCE port.
     10
     11        Set bmiHeader.biSize only at constructor.
     12
     13        * platform/win/BitmapInfo.cpp: Added property svn:eol-style.
     14        (WebCore::bitmapInfoForSize):
     15        (WebCore::BitmapInfo::create):
     16        (WebCore::BitmapInfo::createBottomUp):
     17        * platform/win/BitmapInfo.h: Added property svn:eol-style.
     18        (WebCore::BitmapInfo::is16bit):
     19        (WebCore::BitmapInfo::is32bit):
     20        (WebCore::BitmapInfo::width):
     21        (WebCore::BitmapInfo::height):
     22        (WebCore::BitmapInfo::size):
     23        (WebCore::BitmapInfo::paddedWidth):
     24        (WebCore::BitmapInfo::numPixels):
     25        (WebCore::BitmapInfo::paddedBytesPerLine):
     26        (WebCore::BitmapInfo::bytesPerLine):
     27
    1282010-07-22  MORITA Hajime  <morrita@google.com>
    229
  • trunk/WebCore/platform/win/BitmapInfo.cpp

    r44789 r63944  
    22 * Copyright (C) 2009 Apple Inc. All Rights Reserved.
    33 * Copyright (C) 2009 Brent Fulgham
     4 * Copyright (C) 2007-2009 Torch Mobile, Inc. All Rights Reserved.
     5 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
    46 *
    57 * Redistribution and use in source and binary forms, with or without
     
    2830#include "BitmapInfo.h"
    2931
     32#include <wtf/Assertions.h>
     33
    3034namespace WebCore {
    3135
    32 BitmapInfo bitmapInfoForSize(int width, int height)
     36BitmapInfo bitmapInfoForSize(int width, int height, WORD bitCount)
    3337{
     38    ASSERT_ARG(bitCount, bitCount == 16 || bitCount == 32);
     39
    3440    BitmapInfo bitmapInfo;
    35     bitmapInfo.bmiHeader.biSize          = sizeof(BITMAPINFOHEADER);
    36     bitmapInfo.bmiHeader.biWidth         = width;
     41    bitmapInfo.bmiHeader.biWidth         = width;
    3742    bitmapInfo.bmiHeader.biHeight        = height;
    3843    bitmapInfo.bmiHeader.biPlanes        = 1;
    39     bitmapInfo.bmiHeader.biBitCount      = 32;
     44    bitmapInfo.bmiHeader.biBitCount      = bitCount;
    4045    bitmapInfo.bmiHeader.biCompression   = BI_RGB;
    4146    bitmapInfo.bmiHeader.biSizeImage     = 0;
     
    5459}
    5560
    56 BitmapInfo BitmapInfo::create(const IntSize& size)
     61BitmapInfo BitmapInfo::create(const IntSize& size, WORD bitCount)
    5762{
    58    return bitmapInfoForSize(size.width(), size.height());
     63    return bitmapInfoForSize(size.width(), size.height(), bitCount);
    5964}
    6065
    61 BitmapInfo BitmapInfo::createBottomUp(const IntSize& size)
     66BitmapInfo BitmapInfo::createBottomUp(const IntSize& size, WORD bitCount)
    6267{
    63    return bitmapInfoForSize(size.width(), -size.height());
     68    return bitmapInfoForSize(size.width(), -size.height(), bitCount);
    6469}
    6570
Note: See TracChangeset for help on using the changeset viewer.