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

Side by Side Diff: fpdfsdk/fpdfview.cpp

Issue 2520073003: handle antialiased rendering as premultiplied (Closed)
Patch Set: more work on premultiplied mismatch Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/fpdfformfill.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "public/fpdfview.h" 7 #include "public/fpdfview.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 CPDF_PageRenderContext* pContext = new CPDF_PageRenderContext; 591 CPDF_PageRenderContext* pContext = new CPDF_PageRenderContext;
592 pPage->SetRenderContext(pdfium::WrapUnique(pContext)); 592 pPage->SetRenderContext(pdfium::WrapUnique(pContext));
593 CFX_FxgeDevice* pDevice = new CFX_FxgeDevice; 593 CFX_FxgeDevice* pDevice = new CFX_FxgeDevice;
594 pContext->m_pDevice.reset(pDevice); 594 pContext->m_pDevice.reset(pDevice);
595 CFX_DIBitmap* pBitmap = CFXBitmapFromFPDFBitmap(bitmap); 595 CFX_DIBitmap* pBitmap = CFXBitmapFromFPDFBitmap(bitmap);
596 pDevice->Attach(pBitmap, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false); 596 pDevice->Attach(pBitmap, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false);
597 597
598 FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y, 598 FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y,
599 rotate, flags, true, nullptr); 599 rotate, flags, true, nullptr);
600 600
601 #ifdef _SKIA_SUPPORT_PATHS_
602 pBitmap->UnPreMultiply();
603 #endif
601 pPage->SetRenderContext(nullptr); 604 pPage->SetRenderContext(nullptr);
602 } 605 }
603 606
604 #ifdef _SKIA_SUPPORT_ 607 #ifdef _SKIA_SUPPORT_
605 DLLEXPORT FPDF_RECORDER STDCALL FPDF_RenderPageSkp(FPDF_PAGE page, 608 DLLEXPORT FPDF_RECORDER STDCALL FPDF_RenderPageSkp(FPDF_PAGE page,
606 int size_x, 609 int size_x,
607 int size_y) { 610 int size_y) {
608 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); 611 CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
609 if (!pPage) 612 if (!pPage)
610 return nullptr; 613 return nullptr;
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 if (!buffer) { 1111 if (!buffer) {
1109 *buflen = len; 1112 *buflen = len;
1110 } else if (*buflen >= len) { 1113 } else if (*buflen >= len) {
1111 memcpy(buffer, utf16Name.c_str(), len); 1114 memcpy(buffer, utf16Name.c_str(), len);
1112 *buflen = len; 1115 *buflen = len;
1113 } else { 1116 } else {
1114 *buflen = -1; 1117 *buflen = -1;
1115 } 1118 }
1116 return (FPDF_DEST)pDestObj; 1119 return (FPDF_DEST)pDestObj;
1117 } 1120 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdfformfill.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698