Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Issue 1023223002: Revert of PDF: remove last use of SkPDFImage (Closed)

Created:
5 years, 9 months ago by scroggo
Modified:
5 years, 9 months ago
Reviewers:
hal.canary, mtklein, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Revert of PDF: remove last use of SkPDFImage (patchset #5 id:120001 of https://codereview.chromium.org/950633003/) Reason for revert: Broke on Mac due to line 82 in the test. We assert that a gif is Index8, but Mac's decoder decodes it to 8888 (Not sure what windows does...) Original issue's description: > PDF: remove last use of SkPDFImage > > Add a GM. > > BUG=skia:255 > > Committed: https://skia.googlesource.com/skia/+/86ad8d643624a55b02e529100bbe4e2940115fa1 TBR=mtklein@google.com,reed@google.com,halcanary@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:255

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1010 lines, -378 lines) Patch
D gm/all_bitmap_configs.cpp View 1 chunk +0 lines, -93 lines 0 comments Download
M gyp/gmslides.gypi View 1 chunk +0 lines, -1 line 0 comments Download
M gyp/pdf.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M src/pdf/SkPDFBitmap.h View 2 chunks +7 lines, -4 lines 0 comments Download
M src/pdf/SkPDFBitmap.cpp View 4 chunks +179 lines, -272 lines 0 comments Download
M src/pdf/SkPDFDevice.cpp View 3 chunks +4 lines, -8 lines 0 comments Download
A src/pdf/SkPDFImage.h View 1 chunk +91 lines, -0 lines 0 comments Download
A src/pdf/SkPDFImage.cpp View 1 chunk +727 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (1 generated)
scroggo
Created Revert of PDF: remove last use of SkPDFImage
5 years, 9 months ago (2015-03-20 17:03:32 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1023223002/1
5 years, 9 months ago (2015-03-20 17:04:06 UTC) #2
commit-bot: I haz the power
Failed to apply patch for gm/all_bitmap_configs.cpp: While running git rm gm/all_bitmap_configs.cpp; fatal: pathspec 'gm/all_bitmap_configs.cpp' did ...
5 years, 9 months ago (2015-03-20 17:04:14 UTC) #4
scroggo
5 years, 9 months ago (2015-03-20 17:05:01 UTC) #5
Message was sent while issue was closed.
On 2015/03/20 17:04:14, I haz the power (commit-bot) wrote:
> Failed to apply patch for gm/all_bitmap_configs.cpp:
> While running git rm gm/all_bitmap_configs.cpp;
>   fatal: pathspec 'gm/all_bitmap_configs.cpp' did not match any files
> 
> Patch:  D    gm/all_bitmap_configs.cpp
> Index: gm/all_bitmap_configs.cpp
> diff --git a/gm/all_bitmap_configs.cpp b/gm/all_bitmap_configs.cpp
> deleted file mode 100644
> index
>
95568f2ecfc70caaf3d78a83cd323cac749e1f71..0000000000000000000000000000000000000000
> --- a/gm/all_bitmap_configs.cpp
> +++ /dev/null
> @@ -1,93 +0,0 @@
> -/*
> - * Copyright 2015 Google Inc.
> - *
> - * Use of this source code is governed by a BSD-style license that can be
> - * found in the LICENSE file.
> - */
> -
> -#include "sk_tool_utils.h"
> -#include "SkSurface.h"
> -#include "Resources.h"
> -#include "gm.h"
> -
> -static SkBitmap copy_bitmap(const SkBitmap& src, SkColorType colorType) {
> -    SkBitmap copy;
> -    src.copyTo(&copy, colorType);
> -    copy.setImmutable();
> -    return copy;
> -}
> -
> -// Make either A8 or gray8 bitmap.
> -static SkBitmap make_bitmap(bool alpha) {
> -    SkBitmap bm;
> -    SkImageInfo info = alpha ? SkImageInfo::MakeA8(128, 128)
> -                             : SkImageInfo::Make(128, 128,
kGray_8_SkColorType,
> -                                                 kOpaque_SkAlphaType);
> -    bm.allocPixels(info);
> -    SkAutoLockPixels autoLockPixels(bm);
> -    uint8_t spectrum[256];
> -    for (int y = 0; y < 256; ++y) {
> -        spectrum[y] = y;
> -    }
> -    for (int y = 0; y < 128; ++y) {
> -        // Shift over one byte each scanline.
> -        memcpy(bm.getAddr8(0, y), &spectrum[y], 128);
> -    }
> -    bm.setImmutable();
> -    return bm;
> -}
> -
> -static void draw(SkCanvas* canvas,
> -                 const SkPaint& p,
> -                 const SkBitmap& src,
> -                 SkColorType colorType,
> -                 const char text[]) {
> -    SkASSERT(src.colorType() == colorType);
> -    canvas->drawBitmap(src, 0.0f, 0.0f);
> -    canvas->drawText(text, strlen(text), 0.0f, 12.0f, p);
> -}
> -
> -#define SCALE 128
> -DEF_SIMPLE_GM(all_bitmap_configs, canvas, SCALE, 6 * SCALE) {
> -    SkAutoCanvasRestore autoCanvasRestore(canvas, true);
> -    SkPaint p;
> -    p.setColor(SK_ColorBLACK);
> -    p.setAntiAlias(true);
> -    sk_tool_utils::set_portable_typeface(&p, NULL, SkTypeface::kBold);
> -
> -    sk_tool_utils::draw_checkerboard(canvas, SK_ColorLTGRAY, SK_ColorWHITE,
8);
> -
> -    SkBitmap bitmap;
> -    if (GetResourceAsBitmap("color_wheel.png", &bitmap)) {
> -        bitmap.setImmutable();
> -        draw(canvas, p, bitmap, kN32_SkColorType, "Native 32");
> -
> -        canvas->translate(0.0f, SkIntToScalar(SCALE));
> -        SkBitmap copy565 = copy_bitmap(bitmap, kRGB_565_SkColorType);
> -        p.setColor(SK_ColorRED);
> -        draw(canvas, p, copy565, kRGB_565_SkColorType, "RGB 565");
> -        p.setColor(SK_ColorBLACK);
> -
> -        canvas->translate(0.0f, SkIntToScalar(SCALE));
> -        SkBitmap copy4444 = copy_bitmap(bitmap, kARGB_4444_SkColorType);
> -        draw(canvas, p, copy4444, kARGB_4444_SkColorType, "ARGB 4444");
> -    } else {
> -        canvas->translate(0.0f, SkIntToScalar(2 * SCALE));
> -    }
> -
> -    canvas->translate(0.0f, SkIntToScalar(SCALE));
> -    SkBitmap bitmapIndexed;
> -    if (GetResourceAsBitmap("color_wheel.gif", &bitmapIndexed)) {
> -        bitmapIndexed.setImmutable();
> -        draw(canvas, p, bitmapIndexed, kIndex_8_SkColorType, "Index 8");
> -    }
> -
> -    canvas->translate(0.0f, SkIntToScalar(SCALE));
> -    SkBitmap bitmapA8 = make_bitmap(true);
> -    draw(canvas, p, bitmapA8, kAlpha_8_SkColorType, "Alpha 8");
> -
> -    p.setColor(SK_ColorRED);
> -    canvas->translate(0.0f, SkIntToScalar(SCALE));
> -    SkBitmap bitmapG8 = make_bitmap(false);
> -    draw(canvas, p, bitmapG8, kGray_8_SkColorType, "Gray 8");
> -}

NVM, Mike beat me to it.

Powered by Google App Engine
This is Rietveld 408576698