From 2d7ab183976259dd9f428bfe3e10966fdd3e5f65 Mon Sep 17 00:00:00 2001 From: jaepark Date: Mon, 1 Aug 2016 18:07:21 -0700 Subject: Support PDF highlight annotation with opacity. BUG=62625 Review-Url: https://codereview.chromium.org/2202063002 --- DEPS | 2 +- core/fpdfdoc/cpvt_generateap.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index fb636a9cba..134703950c 100644 --- a/DEPS +++ b/DEPS @@ -14,7 +14,7 @@ vars = { 'gmock_revision': '29763965ab52f24565299976b936d1265cb6a271', 'gtest_revision': '8245545b6dc9c4703e6496d1efd19e975ad2b038', 'icu_revision': 'a5f86adbb0a58d04c035a5d1228747b1823cd485', - 'pdfium_tests_revision': '62d61d99f65f4a9ce266ca0ecf74bc098d397fd3', + 'pdfium_tests_revision': 'b63db0698bd3cac932807eb552e565b89dd2df9d', 'skia_revision': '7d46f4af7dc759002537a172af121f2bfe200981', 'tools_memory_revision': '427f10475e1a8d72424c29d00bf689122b738e5d', 'trace_event_revision': '54b8455be9505c2cb0cf5c26bb86739c236471aa', diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp index 56b6612717..13ef506158 100644 --- a/core/fpdfdoc/cpvt_generateap.cpp +++ b/core/fpdfdoc/cpvt_generateap.cpp @@ -538,8 +538,11 @@ bool CPVT_GenerateAP::GenerateHighlightAP(CPDF_Document* pDoc, CPDF_Dictionary* pGSDict = new CPDF_Dictionary; pGSDict->SetAtString("Type", "ExtGState"); - pGSDict->SetAtNumber("ca", 1); - pGSDict->SetAtNumber("CA", 1); + + FX_FLOAT fOpacity = + pAnnotDict->KeyExist("CA") ? pAnnotDict->GetNumberBy("CA") : 1; + pGSDict->SetAtNumber("ca", fOpacity); + pGSDict->SetAtNumber("CA", fOpacity); pGSDict->SetAtBoolean("AIS", false); pGSDict->SetAtString("BM", "Multiply"); -- cgit v1.2.3