Skip to content
Permalink
Browse files
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):

Canonical link: https://commits.webkit.org/54777@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@63944 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
webkit-commit-queue committed Jul 23, 2010
1 parent 95c655d commit 22d53bc9d643660fbf963afc0f307f5747ba862c
Showing with 40 additions and 8 deletions.
  1. +27 −0 WebCore/ChangeLog
  2. +13 −8 WebCore/platform/win/BitmapInfo.cpp
@@ -1,3 +1,30 @@
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):

2010-07-22 MORITA Hajime <morrita@google.com>

Reviewed by Ojan Vafai.
@@ -1,6 +1,8 @@
/*
* Copyright (C) 2009 Apple Inc. All Rights Reserved.
* Copyright (C) 2009 Brent Fulgham
* Copyright (C) 2007-2009 Torch Mobile, Inc. All Rights Reserved.
* Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,16 +29,19 @@
#include "config.h"
#include "BitmapInfo.h"

#include <wtf/Assertions.h>

namespace WebCore {

BitmapInfo bitmapInfoForSize(int width, int height)
BitmapInfo bitmapInfoForSize(int width, int height, WORD bitCount)
{
ASSERT_ARG(bitCount, bitCount == 16 || bitCount == 32);

BitmapInfo bitmapInfo;
bitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bitmapInfo.bmiHeader.biWidth = width;
bitmapInfo.bmiHeader.biWidth = width;
bitmapInfo.bmiHeader.biHeight = height;
bitmapInfo.bmiHeader.biPlanes = 1;
bitmapInfo.bmiHeader.biBitCount = 32;
bitmapInfo.bmiHeader.biBitCount = bitCount;
bitmapInfo.bmiHeader.biCompression = BI_RGB;
bitmapInfo.bmiHeader.biSizeImage = 0;
bitmapInfo.bmiHeader.biXPelsPerMeter = 0;
@@ -53,14 +58,14 @@ BitmapInfo::BitmapInfo()
bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
}

BitmapInfo BitmapInfo::create(const IntSize& size)
BitmapInfo BitmapInfo::create(const IntSize& size, WORD bitCount)
{
return bitmapInfoForSize(size.width(), size.height());
return bitmapInfoForSize(size.width(), size.height(), bitCount);
}

BitmapInfo BitmapInfo::createBottomUp(const IntSize& size)
BitmapInfo BitmapInfo::createBottomUp(const IntSize& size, WORD bitCount)
{
return bitmapInfoForSize(size.width(), -size.height());
return bitmapInfoForSize(size.width(), -size.height(), bitCount);
}

} // namespace WebCore

0 comments on commit 22d53bc

Please sign in to comment.