Changeset 141284 in webkit


Ignore:
Timestamp:
Jan 30, 2013 10:52:42 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] Screenshot is clipped when content is smaller than the desintation size
https://bugs.webkit.org/show_bug.cgi?id=107735

Patch by Ed Baker <edbaker@rim.com> on 2013-01-30
Reviewed by Rob Buis.

Internal PR #284662
Don't scale the transformed content rect when the content is smaller than the destination
size. Scale the graphics context when it has a scale factor that isn't 1.0.

Internally reviewed by Andrew Lo

  • Api/BackingStore.cpp:

(BlackBerry::WebKit::BackingStorePrivate::renderContents):

Location:
trunk/Source/WebKit/blackberry
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/blackberry/Api/BackingStore.cpp

    r140477 r141284  
    19131913    float heightScale = static_cast<float>(destinationSize.height()) / contentsRect.height();
    19141914
    1915     if (widthScale != 1.0 && heightScale != 1.0) {
     1915    // Don't scale the transformed content rect when the content is smaller than the destination
     1916    if (widthScale < 1.0 && heightScale < 1.0) {
    19161917        TransformationMatrix matrix;
    19171918        matrix.scaleNonUniform(1.0 / widthScale, 1.0 / heightScale);
    19181919        transformedContentsRect = matrix.mapRect(transformedContentsRect);
    1919 
    19201920        // We extract from the contentsRect but draw a slightly larger region than
    19211921        // we were told to, in order to avoid pixels being rendered only partially.
    19221922        const int atLeastOneDevicePixel = static_cast<int>(ceilf(std::max(1.0 / widthScale, 1.0 / heightScale)));
    19231923        transformedContentsRect.inflate(atLeastOneDevicePixel);
     1924    }
     1925
     1926    if (widthScale != 1.0 && heightScale != 1.0)
    19241927        graphicsContext.scale(FloatSize(widthScale, heightScale));
    1925     }
    19261928
    19271929    graphicsContext.clip(transformedContentsRect);
  • trunk/Source/WebKit/blackberry/ChangeLog

    r141276 r141284  
     12013-01-30  Ed Baker  <edbaker@rim.com>
     2
     3        [BlackBerry] Screenshot is clipped when content is smaller than the desintation size
     4        https://bugs.webkit.org/show_bug.cgi?id=107735
     5
     6        Reviewed by Rob Buis.
     7
     8        Internal PR #284662
     9        Don't scale the transformed content rect when the content is smaller than the destination
     10        size. Scale the graphics context when it has a scale factor that isn't 1.0.
     11
     12        Internally reviewed by Andrew Lo
     13
     14        * Api/BackingStore.cpp:
     15        (BlackBerry::WebKit::BackingStorePrivate::renderContents):
     16
    1172013-01-30  Xiaobo Wang  <xbwang@torchmobile.com.cn>
    218
Note: See TracChangeset for help on using the changeset viewer.