diff --git a/.gitignore b/.gitignore
index 899c8410de..348281875a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,4 @@
 /base
-/build
 /buildtools
 /out
 /testing/corpus
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000000..f65cf03a13
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,577 @@
+PROJECT (pdfium)
+CMAKE_MINIMUM_REQUIRED (VERSION 2.8.12)
+
+set(USE_BINUTILS_WORKAROUND ON CACHE BOOL "use gcc-ar and gcc-ranlib instead ar and ranlib (is needed for LTO)")
+if(USE_BINUTILS_WORKAROUND)
+    set(CMAKE_AR gcc-ar)
+    set(CMAKE_RANLIB gcc-ranlib)
+endif(USE_BINUTILS_WORKAROUND)
+
+if(APPLE OR LINUX)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -fno-exceptions -Wc++0x-compat  -fvisibility=hidden")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
+endif(APPLE OR LINUX)
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/public)
+
+if(WIN32)
+  add_definitions(-D_WIN32 -DWIN32_LEAN_AND_MEAN -DNOMINMAX)
+  file(GLOB PLATFORM_SOURCES
+    "core/fxge/win32/*.cpp"
+    "core/fxge/win32/*.h"
+  )
+elseif(APPLE)
+  file(GLOB PLATFORM_SOURCES
+    "core/fxge/apple/*.cpp"
+    "core/fxge/apple/*.h"
+  )
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -pthread")
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -Wl,-z,defs")
+elseif(UNIX)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+  file(GLOB PLATFORM_SOURCES
+    "core/fxge/linux/*.cpp"
+    "core/fxge/linix/*.h"
+  )
+endif(WIN32)
+
+set(USE_STATIC_LIBRARY ON CACHE BOOL "build as static library. Otherwise - shared")
+
+#hieroglyphs support
+set(USE_GB1_MAPS OFF CACHE BOOL "use GB1 maps")
+set(USE_CNS1_MAPS OFF CACHE BOOL "use CNS1 maps")
+set(USE_JAPAN1_MAPS OFF CACHE BOOL "use JAPAN1 maps")
+set(USE_KOREA_MAPS OFF CACHE BOOL "use KOREA maps")
+# set(USE_JPX_DECODER OFF CACHE BOOL "use jpx-decoder")
+
+if(USE_CNS1_MAPS)
+  add_definitions(-DUSE_CNS1_MAPS)
+  set(FPDFAPI_CNS1_SOURCES
+core/ffpdfapi/cmaps/CNS1/Adobe-CNS1-UCS2_5.cpp
+core/ffpdfapi/cmaps/CNS1/B5pc-H_0.cpp
+core/ffpdfapi/cmaps/CNS1/B5pc-V_0.cpp
+core/ffpdfapi/cmaps/CNS1/cmaps_cns1.cpp
+core/ffpdfapi/cmaps/CNS1/cmaps_cns1.h
+core/ffpdfapi/cmaps/CNS1/CNS-EUC-H_0.cpp
+core/ffpdfapi/cmaps/CNS1/CNS-EUC-V_0.cpp
+core/ffpdfapi/cmaps/CNS1/ETen-B5-H_0.cpp
+core/ffpdfapi/cmaps/CNS1/ETen-B5-V_0.cpp
+core/ffpdfapi/cmaps/CNS1/ETenms-B5-H_0.cpp
+core/ffpdfapi/cmaps/CNS1/ETenms-B5-V_0.cpp
+core/ffpdfapi/cmaps/CNS1/HKscs-B5-H_5.cpp
+core/ffpdfapi/cmaps/CNS1/HKscs-B5-V_5.cpp
+core/ffpdfapi/cmaps/CNS1/UniCNS-UCS2-H_3.cpp
+core/ffpdfapi/cmaps/CNS1/UniCNS-UCS2-V_3.cpp
+core/ffpdfapi/cmaps/CNS1/UniCNS-UTF16-H_0.cpp
+)
+endif(USE_CNS1_MAPS)
+
+if(USE_GB1_MAPS)
+  add_definitions(-DUSE_GB1_MAPS)
+  set(FPDFAPI_GB1_SOURCES
+core/ffpdfapi/cmaps/GB1/Adobe-GB1-UCS2_5.cpp
+core/ffpdfapi/cmaps/GB1/cmaps_gb1.cpp
+core/ffpdfapi/cmaps/GB1/cmaps_gb1.h
+core/ffpdfapi/cmaps/GB1/GB-EUC-H_0.cpp
+core/ffpdfapi/cmaps/GB1/GB-EUC-V_0.cpp
+core/ffpdfapi/cmaps/GB1/GBK2K-H_5.cpp
+core/ffpdfapi/cmaps/GB1/GBK2K-V_5.cpp
+core/ffpdfapi/cmaps/GB1/GBK-EUC-H_2.cpp
+core/ffpdfapi/cmaps/GB1/GBK-EUC-V_2.cpp
+core/ffpdfapi/cmaps/GB1/GBKp-EUC-H_2.cpp
+core/ffpdfapi/cmaps/GB1/GBKp-EUC-V_2.cpp
+core/ffpdfapi/cmaps/GB1/GBpc-EUC-H_0.cpp
+core/ffpdfapi/cmaps/GB1/GBpc-EUC-V_0.cpp
+core/ffpdfapi/cmaps/GB1/UniGB-UCS2-H_4.cpp
+core/ffpdfapi/cmaps/GB1/UniGB-UCS2-V_4.cpp )
+endif(USE_GB1_MAPS)
+
+if(USE_JAPAN1_MAPS)
+  set(FPDFAPI_JAPAN1_SOURCES
+core/ffpdfapi/cmaps/Japan1/83pv-RKSJ-H_1.cpp
+core/ffpdfapi/cmaps/Japan1/90msp-RKSJ-H_2.cpp
+core/ffpdfapi/cmaps/Japan1/90msp-RKSJ-V_2.cpp
+core/ffpdfapi/cmaps/Japan1/90ms-RKSJ-H_2.cpp
+core/ffpdfapi/cmaps/Japan1/90ms-RKSJ-V_2.cpp
+core/ffpdfapi/cmaps/Japan1/90pv-RKSJ-H_1.cpp
+core/ffpdfapi/cmaps/Japan1/Add-RKSJ-H_1.cpp
+core/ffpdfapi/cmaps/Japan1/Add-RKSJ-V_1.cpp
+core/ffpdfapi/cmaps/Japan1/Adobe-Japan1-UCS2_4.cpp
+core/ffpdfapi/cmaps/Japan1/cmaps_japan1.cpp
+core/ffpdfapi/cmaps/Japan1/cmaps_japan1.h
+core/ffpdfapi/cmaps/Japan1/EUC-H_1.cpp
+core/ffpdfapi/cmaps/Japan1/EUC-V_1.cpp
+core/ffpdfapi/cmaps/Japan1/Ext-RKSJ-H_2.cpp
+core/ffpdfapi/cmaps/Japan1/Ext-RKSJ-V_2.cpp
+core/ffpdfapi/cmaps/Japan1/H_1.cpp
+core/ffpdfapi/cmaps/Japan1/UniJIS-UCS2-H_4.cpp
+core/ffpdfapi/cmaps/Japan1/UniJIS-UCS2-HW-H_4.cpp
+core/ffpdfapi/cmaps/Japan1/UniJIS-UCS2-HW-V_4.cpp
+core/ffpdfapi/cmaps/Japan1/UniJIS-UCS2-V_4.cpp
+core/ffpdfapi/cmaps/Japan1/V_1.cpp  )
+  add_definitions(-DUSE_JAPAN1_MAPS)
+endif(USE_JAPAN1_MAPS)
+
+if(USE_KOREA_MAPS)
+  add_definitions(-DUSE_KOREA_MAPS)
+  set(FPDFAPI_KOREA_SOURCES
+core/ffpdfapi/cmaps/Korea1/Adobe-Korea1-UCS2_2.cpp
+core/ffpdfapi/cmaps/Korea1/cmaps_korea1.cpp
+core/ffpdfapi/cmaps/Korea1/cmaps_korea1.h
+core/ffpdfapi/cmaps/Korea1/KSC-EUC-H_0.cpp
+core/ffpdfapi/cmaps/Korea1/KSC-EUC-V_0.cpp
+core/ffpdfapi/cmaps/Korea1/KSCms-UHC-H_1.cpp
+core/ffpdfapi/cmaps/Korea1/KSCms-UHC-HW-H_1.cpp
+core/ffpdfapi/cmaps/Korea1/KSCms-UHC-HW-V_1.cpp
+core/ffpdfapi/cmaps/Korea1/KSCms-UHC-V_1.cpp
+core/ffpdfapi/cmaps/Korea1/KSCpc-EUC-H_0.cpp
+core/ffpdfapi/cmaps/Korea1/UniKS-UCS2-H_1.cpp
+core/ffpdfapi/cmaps/Korea1/UniKS-UCS2-V_1.cpp
+core/ffpdfapi/cmaps/Korea1/UniKS-UTF16-H_0.cpp
+  )
+endif(USE_KOREA_MAPS)
+#find_package(Freetype REQUIRED)
+
+#Use own jbig2 in anytime
+#add_subdirectory(core/fxcodec/jbig2)
+
+######################### FPDFSDK #############################################
+set(FPDFSDK_SOURCES
+    "fpdfsdk/cpdfsdk_actionhandler.cpp"
+    "fpdfsdk/cpdfsdk_actionhandler.h"
+    "fpdfsdk/cpdfsdk_annot.cpp"
+    "fpdfsdk/cpdfsdk_annot.h"
+    "fpdfsdk/cpdfsdk_annothandlermgr.cpp"
+    "fpdfsdk/cpdfsdk_annothandlermgr.h"
+    "fpdfsdk/cpdfsdk_annotiteration.cpp"
+    "fpdfsdk/cpdfsdk_annotiteration.h"
+    "fpdfsdk/cpdfsdk_annotiterator.cpp"
+    "fpdfsdk/cpdfsdk_annotiterator.h"
+    "fpdfsdk/cpdfsdk_appstream.cpp"
+    "fpdfsdk/cpdfsdk_appstream.h"
+    "fpdfsdk/cpdfsdk_baannot.cpp"
+    "fpdfsdk/cpdfsdk_baannot.h"
+    "fpdfsdk/cpdfsdk_baannothandler.cpp"
+    "fpdfsdk/cpdfsdk_baannothandler.h"
+    "fpdfsdk/cpdfsdk_customaccess.cpp"
+    "fpdfsdk/cpdfsdk_customaccess.h"
+    "fpdfsdk/cpdfsdk_filewriteadapter.cpp"
+    "fpdfsdk/cpdfsdk_filewriteadapter.h"
+    "fpdfsdk/cpdfsdk_formfillenvironment.cpp"
+    "fpdfsdk/cpdfsdk_formfillenvironment.h"
+    "fpdfsdk/cpdfsdk_helpers.cpp"
+    "fpdfsdk/cpdfsdk_helpers.h"
+    "fpdfsdk/cpdfsdk_interactiveform.cpp"
+    "fpdfsdk/cpdfsdk_interactiveform.h"
+    "fpdfsdk/cpdfsdk_pageview.cpp"
+    "fpdfsdk/cpdfsdk_pageview.h"
+    "fpdfsdk/cpdfsdk_pauseadapter.cpp"
+    "fpdfsdk/cpdfsdk_pauseadapter.h"
+    "fpdfsdk/cpdfsdk_renderpage.cpp"
+    "fpdfsdk/cpdfsdk_renderpage.h"
+    "fpdfsdk/cpdfsdk_widget.cpp"
+    "fpdfsdk/cpdfsdk_widget.h"
+    "fpdfsdk/cpdfsdk_widgethandler.cpp"
+    "fpdfsdk/cpdfsdk_widgethandler.h"
+    "fpdfsdk/fpdf_annot.cpp"
+    "fpdfsdk/fpdf_attachment.cpp"
+    "fpdfsdk/fpdf_catalog.cpp"
+    "fpdfsdk/fpdf_dataavail.cpp"
+    "fpdfsdk/fpdf_doc.cpp"
+    "fpdfsdk/fpdf_editimg.cpp"
+    "fpdfsdk/fpdf_editpage.cpp"
+    "fpdfsdk/fpdf_editpath.cpp"
+    "fpdfsdk/fpdf_edittext.cpp"
+    "fpdfsdk/fpdf_ext.cpp"
+    "fpdfsdk/fpdf_flatten.cpp"
+    "fpdfsdk/fpdf_formfill.cpp"
+    "fpdfsdk/fpdf_javascript.cpp"
+    "fpdfsdk/fpdf_ppo.cpp"
+    "fpdfsdk/fpdf_progressive.cpp"
+    "fpdfsdk/fpdf_save.cpp"
+    "fpdfsdk/fpdf_searchex.cpp"
+    "fpdfsdk/fpdf_signature.cpp"
+    "fpdfsdk/fpdf_structtree.cpp"
+    "fpdfsdk/fpdf_sysfontinfo.cpp"
+    "fpdfsdk/fpdf_text.cpp"
+    "fpdfsdk/fpdf_thumbnail.cpp"
+    "fpdfsdk/fpdf_transformpage.cpp"
+    "fpdfsdk/fpdf_view.cpp"
+    "fpdfsdk/ipdfsdk_annothandler.cpp"
+    "fpdfsdk/ipdfsdk_annothandler.h"
+    )
+######################## FDRM #############################################
+set(FDRM_SOURCES
+core/fdrm/fx_crypt_aes.cpp
+core/fdrm/fx_crypt.cpp
+core/fdrm/fx_crypt.h
+core/fdrm/fx_crypt_sha.cpp
+#core/fdrm/crypt/fx_crypt_unittest.cpp
+)
+
+######################## FPDFDOC ###########################################
+set(FPDFDOC_SOURCES
+core/fpdfdoc/cpdf_aaction.cpp
+core/fpdfdoc/cpdf_aaction.h
+core/fpdfdoc/cpdf_action.cpp
+#core/fpdfdoc/cpdf_actionfields.cpp
+#core/fpdfdoc/cpdf_actionfields.h
+core/fpdfdoc/cpdf_action.h
+core/fpdfdoc/cpdf_annot.cpp
+core/fpdfdoc/cpdf_annot.h
+core/fpdfdoc/cpdf_annotlist.cpp
+core/fpdfdoc/cpdf_annotlist.h
+core/fpdfdoc/cpdf_apsettings.cpp
+core/fpdfdoc/cpdf_apsettings.h
+core/fpdfdoc/cpdf_bookmark.cpp
+core/fpdfdoc/cpdf_bookmark.h
+core/fpdfdoc/cpdf_bookmarktree.cpp
+core/fpdfdoc/cpdf_bookmarktree.h
+core/fpdfdoc/cpdf_defaultappearance.cpp
+core/fpdfdoc/cpdf_defaultappearance.h
+core/fpdfdoc/cpdf_dest.cpp
+core/fpdfdoc/cpdf_dest.h
+#core/fpdfdoc/cpdf_dest_unittest.cpp
+#core/fpdfdoc/cpdf_docjsactions.cpp
+#core/fpdfdoc/cpdf_docjsactions.h
+core/fpdfdoc/cpdf_filespec.cpp
+core/fpdfdoc/cpdf_filespec.h
+#core/fpdfdoc/cpdf_filespec_unittest.cpp
+core/fpdfdoc/cpdf_formcontrol.cpp
+core/fpdfdoc/cpdf_formcontrol.h
+core/fpdfdoc/cpdf_formfield.cpp
+core/fpdfdoc/cpdf_formfield.h
+#core/fpdfdoc/cpdf_formfield_unittest.cpp
+core/fpdfdoc/cpdf_iconfit.cpp
+core/fpdfdoc/cpdf_iconfit.h
+#core/fpdfdoc/cpdf_interform.cpp
+#core/fpdfdoc/cpdf_interform.h
+core/fpdfdoc/cpdf_link.cpp
+core/fpdfdoc/cpdf_link.h
+core/fpdfdoc/cpdf_linklist.cpp
+core/fpdfdoc/cpdf_linklist.h
+core/fpdfdoc/cpdf_metadata.cpp
+core/fpdfdoc/cpdf_metadata.h
+core/fpdfdoc/cpdf_nametree.cpp
+core/fpdfdoc/cpdf_nametree.h
+core/fpdfdoc/cpdf_numbertree.cpp
+core/fpdfdoc/cpdf_numbertree.h
+#core/fpdfdoc/cpdf_occontext.cpp
+#core/fpdfdoc/cpdf_occontext.h
+core/fpdfdoc/cpdf_pagelabel.cpp
+core/fpdfdoc/cpdf_pagelabel.h
+#core/fpdfdoc/cpdf_variabletext.cpp
+#core/fpdfdoc/cpdf_variabletext.h
+core/fpdfdoc/cpdf_viewerpreferences.cpp
+core/fpdfdoc/cpdf_viewerpreferences.h
+#core/fpdfdoc/cpvt_arraytemplate.h
+#core/fpdfdoc/cpvt_color.cpp
+#core/fpdfdoc/cpvt_color.h
+#core/fpdfdoc/cpvt_dash.h
+core/fpdfdoc/cpvt_floatrect.h
+core/fpdfdoc/cpvt_fontmap.cpp
+core/fpdfdoc/cpvt_fontmap.h
+#core/fpdfdoc/cpvt_generateap.cpp
+#core/fpdfdoc/cpvt_generateap.h
+core/fpdfdoc/cpvt_line.h
+core/fpdfdoc/cpvt_lineinfo.h
+#core/fpdfdoc/cpvt_secprops.h
+core/fpdfdoc/cpvt_section.h
+#core/fpdfdoc/cpvt_sectioninfo.cpp
+#core/fpdfdoc/cpvt_sectioninfo.h
+core/fpdfdoc/cpvt_word.h
+core/fpdfdoc/cpvt_wordinfo.cpp
+core/fpdfdoc/cpvt_wordinfo.h
+core/fpdfdoc/cpvt_wordplace.h
+#core/fpdfdoc/cpvt_wordprops.h
+core/fpdfdoc/cpvt_wordrange.h
+#core/fpdfdoc/csection.cpp
+#core/fpdfdoc/csection.h
+#core/fpdfdoc/ctypeset.cpp
+#core/fpdfdoc/ctypeset.h
+#core/fpdfdoc/#doc_tagged.cpp
+#core/fpdfdoc/fpdf_tagged.h
+#core/fpdfdoc/ipdf_formnotify.h
+core/fpdfdoc/ipvt_fontmap.h
+#core/fpdfdoc/tagged_int.h
+)
+
+######################## FPDFAPI ###########################################
+file (GLOB_RECURSE FPDFAPI_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/core/fpdfapi/*)
+
+######################## FPDFTEXT #############################################
+set(FPDFTEXT_SOURCES
+core/fpdftext/cpdf_linkextract.cpp
+core/fpdftext/cpdf_linkextract.h
+core/fpdftext/cpdf_textpage.cpp
+core/fpdftext/cpdf_textpagefind.cpp
+core/fpdftext/cpdf_textpagefind.h
+core/fpdftext/cpdf_textpage.h
+#core/fpdftext/fpdf_text_int_unittest.cpp
+core/fpdftext/unicodenormalizationdata.cpp
+core/fpdftext/unicodenormalizationdata.h
+)
+
+######################## FXCODEC #############################################
+# TODO rewrite 
+file (GLOB_RECURSE FXCODEC_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/core/fxcodec/*)
+
+######################## FXCRT #############################################
+file (GLOB_RECURSE FXCRT_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/core/fxcrt/*)
+file(GLOB_RECURSE platform_sources
+    "core/fxcrt/*posix*"
+    )
+if(NOT UNIX)
+    list(REMOVE_ITEM FXCRT_SOURCES ${platform_sources})
+endif()
+
+######################## FXGE #############################################
+file (GLOB_RECURSE FXGE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/core/fxge/*)
+file(GLOB_RECURSE to_remove 
+    "core/fxge/*test.cpp"
+    "core/fxge/skia/*"
+    "core/fxge/win32/*"
+    )
+list(REMOVE_ITEM FXGE_SOURCES ${to_remove})
+if(WIN32)
+	file(GLOB_RECURSE to_remove 
+	    "core/fxge/linux/*"
+	    "core/fxge/apple/*"
+	    "core/fxge/android/*"
+	    )
+elseif(APPLE)
+	file(GLOB_RECURSE to_remove 
+        "core/fxge/win32/*"
+	    "core/fxge/linux/*"
+	    "core/fxge/android/*"
+	    )
+elseif(UNIX)
+	file(GLOB_RECURSE to_remove 
+        "core/fxge/win32/*"
+	    "core/fxge/apple/*"
+	    "core/fxge/android/*"
+	    )
+endif()
+list(REMOVE_ITEM FXGE_SOURCES ${to_remove})
+######################## FXEDIT #############################################
+file (GLOB_RECURSE FXEDIT_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/fpdfsdk/pwl/*)
+
+######################## PDFWINDOW #############################################
+file (GLOB_RECURSE PDFWINDOW_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/fpdfsdk/pwl/*)
+
+######################## FORMFILLER #############################################
+file (GLOB_RECURSE FORMFILLER_SOURCES 
+    "core/fpdfdoc/*"
+    "fpdfsdk/formfiller/*.cpp"   
+    "fpdfsdk/formfiller/*.h"
+    )
+
+######################## JS #############################################
+file (GLOB JS_STUB_SOURCES 
+    #fxjs/fpdf_javascript.cpp
+    #fxjs/fpdf_javascript_embeddertest.cpp
+    "fxjs/cjs_event_context_stub.cpp"
+    "fxjs/cjs_event_context_stub.h"
+    "fxjs/cjs_runtimestub.cpp"
+    "fxjs/cjs_runtimestub.h"
+    "fxjs/ijs_event_context.h"
+    "fxjs/ijs_runtime.cpp"
+    "fxjs/ijs_runtime.h"
+    )
+#file(GLOB_RECURSE to_remove 
+
+#    "fxjs/*test.cpp"
+#    "core/fxge/skia/*"
+#    "core/fxge/win32/*"
+#    )
+#list(REMOVE_ITEM FXGE_SOURCES ${to_remove})
+
+######################## BIGINT #############################################
+set(BIGINT_SOURCES
+third_party/bigint/BigInteger.cc
+third_party/bigint/BigInteger.hh
+third_party/bigint/BigIntegerLibrary.hh
+third_party/bigint/BigIntegerUtils.cc
+third_party/bigint/BigIntegerUtils.hh
+third_party/bigint/BigUnsigned.cc
+third_party/bigint/BigUnsigned.hh
+third_party/bigint/BigUnsignedInABase.cc
+third_party/bigint/BigUnsignedInABase.hh
+third_party/bigint/NumberlikeArray.hh
+)
+
+######################## AGG #############################################
+set(AGG_SOURCES
+third_party/agg23/agg_array.h
+third_party/agg23/agg_basics.h
+third_party/agg23/agg_clip_liang_barsky.h
+third_party/agg23/agg_color_gray.h
+third_party/agg23/agg_conv_adaptor_vcgen.h
+third_party/agg23/agg_conv_dash.h
+third_party/agg23/agg_conv_stroke.h
+third_party/agg23/agg_curves.cpp
+third_party/agg23/agg_curves.h
+third_party/agg23/agg_math.h
+third_party/agg23/agg_math_stroke.h
+third_party/agg23/agg_path_storage.cpp
+third_party/agg23/agg_path_storage.h
+third_party/agg23/agg_pixfmt_gray.h
+third_party/agg23/agg_rasterizer_scanline_aa.cpp
+third_party/agg23/agg_rasterizer_scanline_aa.h
+third_party/agg23/agg_renderer_base.h
+third_party/agg23/agg_renderer_scanline.h
+third_party/agg23/agg_rendering_buffer.h
+third_party/agg23/agg_render_scanlines.h
+third_party/agg23/agg_scanline_u.h
+third_party/agg23/agg_shorten_path.h
+third_party/agg23/agg_vcgen_dash.cpp
+third_party/agg23/agg_vcgen_dash.h
+third_party/agg23/agg_vcgen_stroke.cpp
+third_party/agg23/agg_vcgen_stroke.h
+third_party/agg23/agg_vertex_sequence.h
+)
+file(GLOB BASE_SOURCES
+    third_party/base/debug/alias.h
+    third_party/base/debug/alias.cc
+    third_party/base/allocator/partition_allocator/*.cc
+    third_party/base/allocator/partition_allocator/*.h
+    )
+
+file(GLOB OTHER_SOURCES 
+    "constants/*.cpp"
+    "constants/*.h"
+    )
+if(WIN32)
+    file(GLOB to_add 
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/base/win/*
+    )
+endif()
+list(APPEND OTHER_SOURCES ${to_add})
+           
+set(ALL_SOURCES
+    ${FDRM_SOURCES}
+    ${FPDFDOC_SOURCES}
+    ${FPDFAPI_SOURCES} ${FPDFAPI_GB1_SOURCES} ${FPDFAPI_CNS1_SOURCES} ${FPDFAPI_JAPAN1_SOURCES} ${FPDFAPI_KOREA_SOURCES}
+    ${FPDFTEXT_SOURCES}
+    ${FXCODEC_SOURCES}
+    ${FXCRT_SOURCES}
+    ${FXGE_SOURCES}
+    ${FXEDIT_SOURCES}
+    ${PDFWINDOW_SOURCES}
+    ${FORMFILLER_SOURCES}
+    ${FPDFSDK_SOURCES}
+    ${PLATFORM_SOURCES}
+    ${JS_STUB_SOURCES}
+    #${BIGINT_SOURCES}
+    ${AGG_SOURCES}
+    ${OTHER_SOURCES}
+    ${BASE_SOURCES}
+    ${FORMFILLER_SOURCES}
+)
+
+file( GLOB WINDOWS_SOURCES 
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fpdfapi/render/cpdf_windowsrenderdevice.cpp"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fxge/cfx_windows*"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fxcrt/*windows.cpp"
+    )
+if(NOT WIN32)
+    list (REMOVE_ITEM ALL_SOURCES ${WINDOWS_SOURCES})
+endif()
+file( GLOB APPLE_SOURCES 
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fxge/apple/*"
+    )
+if(NOT APPLE)
+    list(REMOVE_ITEM ALL_SOURCES 
+        ${APPLE_SOURCES}
+        )
+endif()
+
+file(GLOB_RECURSE to_remove "${CMAKE_CURRENT_SOURCE_DIR}/core/fpdfapi/*test.cpp"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fpdfapi/edit/*test.cpp"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fpdfapi/*_module_*.cpp"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fpdfapi/*_module.cpp"
+    "${CMAKE_CURRENT_SOURCE_DIR}/*unittest.cpp"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fxcodec/bmp/*"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fxcodec/gif/*"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fxcodec/jpeg/jpeg_progressive_decoder*"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fxcodec/png/*"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fxcodec/progressive_decoder*"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fxcodec/tiff_decoder*"
+
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fxcodec/jpx/cjpx_decoder.*"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fxcodec/jpx/jpx_decode_utils.*"
+
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fxcodec/jpx/jpx_decode_utils.*"
+
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fxcodec/jpeg/*"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fxcodec/jbig2/*"
+
+    #"${CMAKE_CURRENT_SOURCE_DIR}/core/fpdfapi/font/*"
+    #"${CMAKE_CURRENT_SOURCE_DIR}/core/fxge/cfx_*"
+    #"${CMAKE_CURRENT_SOURCE_DIR}/core/fxge/win32/cfx_*"
+    #"${CMAKE_CURRENT_SOURCE_DIR}/core/fxge/fx_font.*"
+    #"${CMAKE_CURRENT_SOURCE_DIR}/core/fxge/freetype/*"
+
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fxge/agg/*"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fxge/skia/*"
+    #"${CMAKE_CURRENT_SOURCE_DIR}/core/fpdfapi/render/*"
+    #"${CMAKE_CURRENT_SOURCE_DIR}/core/fxge/cfx_renderdevice.*"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fpdfapi/render/cpdf_devicebuffer.*"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fpdfapi/render/cpdf_rendershading.*"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fpdfapi/render/cpdf_scaledrenderbuffer.*"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fpdfapi/cmaps/CNS1/*"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fpdfapi/cmaps/GB1/*"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fpdfapi/cmaps/Japan1/*"
+    "${CMAKE_CURRENT_SOURCE_DIR}/core/fpdfapi/cmaps/Korea1/*"
+    
+    "*test.cpp"
+    "${CMAKE_CURRENT_SOURCE_DIR}/*.gn"
+    "${CMAKE_CURRENT_SOURCE_DIR}/*DEPS"
+    "${CMAKE_CURRENT_SOURCE_DIR}/*.md"
+    )
+list(REMOVE_ITEM ALL_SOURCES ${to_remove})
+if(USE_STATIC_LIBRARY)
+    add_library(${PROJECT_NAME} STATIC ${ALL_SOURCES})
+else(USE_STATIC_LIBRARY)
+    add_library(${PROJECT_NAME} SHARED ${ALL_SOURCES})
+endif(USE_STATIC_LIBRARY)
+set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "parsing")
+
+target_include_directories(${PROJECT_NAME}
+    PUBLIC
+        ${CMAKE_CURRENT_SOURCE_DIR}
+        ${CMAKE_CURRENT_SOURCE_DIR}/public
+        ./fpdfsdk/include
+)
+
+target_compile_definitions(${PROJECT_NAME} PRIVATE 
+    #USE_SYSTEM_LIBJPEG
+    USE_SYSTEM_ZLIB
+    USE_SYSTEM_ICUUC
+	#USE_SYSTEM_LIBOPENJPEG2
+    )  
+
+target_include_directories(${PROJECT_NAME} PRIVATE  
+    ${CONAN_INCLUDE_DIRS_ABSEIL}
+    #${CONAN_INCLUDE_DIRS_FREETYPE}
+    ${CONAN_INCLUDE_DIRS_ICU}
+    #${CONAN_INCLUDE_DIRS_LIBJPEG}
+    ${CONAN_INCLUDE_DIRS_ZLIB}
+    )
+
+target_link_libraries(${PROJECT_NAME}
+    PUBLIC
+        #CONAN_PKG::openjpeg
+        #CONAN_PKG::libjpeg
+        CONAN_PKG::abseil
+        CONAN_PKG::freetype
+)
+
+#Install
+file(GLOB_RECURSE INSTALL_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/public/*)
+install(FILES ${INSTALL_HEADERS} DESTINATION include/pdfium)
+
+install (TARGETS ${PROJECT_NAME} DESTINATION lib)
diff --git a/build/build_config.h b/build/build_config.h
new file mode 100644
index 0000000000..0102a939a4
--- /dev/null
+++ b/build/build_config.h
@@ -0,0 +1,365 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This file doesn't belong to any GN target by design for faster build and
+// less developer overhead.
+
+// This file adds build flags about the OS we're currently building on. They are
+// defined directly in this file instead of via a `buildflag_header` target in a
+// GN file for faster build. They are defined using the corresponding OS defines
+// (e.g. OS_WIN) which are also defined in this file (except for OS_CHROMEOS,
+// which is set by the build system). These defines are deprecated and should
+// NOT be used directly. For example:
+//    Please Use: #if BUILDFLAG(IS_WIN)
+//    Deprecated: #if defined(OS_WIN)
+//
+//  Operating System:
+//    IS_AIX / IS_ANDROID / IS_ASMJS / IS_CHROMEOS / IS_FREEBSD / IS_FUCHSIA /
+//    IS_IOS / IS_LINUX / IS_MAC / IS_NACL / IS_NETBSD / IS_OPENBSD / IS_QNX /
+//    IS_SOLARIS / IS_WIN
+//  Operating System family:
+//    IS_APPLE: IOS or MAC
+//    IS_BSD: FREEBSD or NETBSD or OPENBSD
+//    IS_POSIX: AIX or ANDROID or ASMJS or CHROMEOS or FREEBSD or IOS or LINUX
+//              or MAC or NACL or NETBSD or OPENBSD or QNX or SOLARIS
+
+// This file also adds defines specific to the platform, architecture etc.
+//
+//  Compiler:
+//    COMPILER_MSVC / COMPILER_GCC
+//
+//  Processor:
+//    ARCH_CPU_ARM64 / ARCH_CPU_ARMEL / ARCH_CPU_LOONG32 / ARCH_CPU_LOONG64 /
+//    ARCH_CPU_MIPS / ARCH_CPU_MIPS64 / ARCH_CPU_MIPS64EL / ARCH_CPU_MIPSEL /
+//    ARCH_CPU_PPC64 / ARCH_CPU_S390 / ARCH_CPU_S390X / ARCH_CPU_X86 /
+//    ARCH_CPU_X86_64 / ARCH_CPU_RISCV64
+//  Processor family:
+//    ARCH_CPU_ARM_FAMILY: ARMEL or ARM64
+//    ARCH_CPU_LOONG_FAMILY: LOONG32 or LOONG64
+//    ARCH_CPU_MIPS_FAMILY: MIPS64EL or MIPSEL or MIPS64 or MIPS
+//    ARCH_CPU_PPC64_FAMILY: PPC64
+//    ARCH_CPU_S390_FAMILY: S390 or S390X
+//    ARCH_CPU_X86_FAMILY: X86 or X86_64
+//    ARCH_CPU_RISCV_FAMILY: Riscv64
+//  Processor features:
+//    ARCH_CPU_31_BITS / ARCH_CPU_32_BITS / ARCH_CPU_64_BITS
+//    ARCH_CPU_BIG_ENDIAN / ARCH_CPU_LITTLE_ENDIAN
+
+#ifndef BUILD_BUILD_CONFIG_H_
+#define BUILD_BUILD_CONFIG_H_
+
+#include "build/buildflag.h"
+
+// A set of macros to use for platform detection.
+#if defined(__native_client__)
+// __native_client__ must be first, so that other OS_ defines are not set.
+#define OS_NACL 1
+#elif defined(ANDROID)
+#define OS_ANDROID 1
+#elif defined(__APPLE__)
+// Only include TargetConditionals after testing ANDROID as some Android builds
+// on the Mac have this header available and it's not needed unless the target
+// is really an Apple platform.
+#include <TargetConditionals.h>
+#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
+#define OS_IOS 1
+#else
+#define OS_MAC 1
+#endif  // defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
+#elif defined(__linux__)
+#if !defined(OS_CHROMEOS)
+// Do not define OS_LINUX on Chrome OS build.
+// The OS_CHROMEOS macro is defined in GN.
+#define OS_LINUX 1
+#endif  // !defined(OS_CHROMEOS)
+// Include a system header to pull in features.h for glibc/uclibc macros.
+#include <assert.h>
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
+// We really are using glibc, not uClibc pretending to be glibc.
+#define LIBC_GLIBC 1
+#endif
+#elif defined(_WIN32)
+#define OS_WIN 1
+#elif defined(__Fuchsia__)
+#define OS_FUCHSIA 1
+#elif defined(__FreeBSD__)
+#define OS_FREEBSD 1
+#elif defined(__NetBSD__)
+#define OS_NETBSD 1
+#elif defined(__OpenBSD__)
+#define OS_OPENBSD 1
+#elif defined(__sun)
+#define OS_SOLARIS 1
+#elif defined(__QNXNTO__)
+#define OS_QNX 1
+#elif defined(_AIX)
+#define OS_AIX 1
+#elif defined(__asmjs__) || defined(__wasm__)
+#define OS_ASMJS 1
+#elif defined(__MVS__)
+#define OS_ZOS 1
+#else
+#error Please add support for your platform in build/build_config.h
+#endif
+// NOTE: Adding a new port? Please follow
+// https://chromium.googlesource.com/chromium/src/+/main/docs/new_port_policy.md
+
+#if defined(OS_MAC) || defined(OS_IOS)
+#define OS_APPLE 1
+#endif
+
+// For access to standard BSD features, use OS_BSD instead of a
+// more specific macro.
+#if defined(OS_FREEBSD) || defined(OS_NETBSD) || defined(OS_OPENBSD)
+#define OS_BSD 1
+#endif
+
+// For access to standard POSIXish features, use OS_POSIX instead of a
+// more specific macro.
+#if defined(OS_AIX) || defined(OS_ANDROID) || defined(OS_ASMJS) ||  \
+    defined(OS_FREEBSD) || defined(OS_IOS) || defined(OS_LINUX) ||  \
+    defined(OS_CHROMEOS) || defined(OS_MAC) || defined(OS_NACL) ||  \
+    defined(OS_NETBSD) || defined(OS_OPENBSD) || defined(OS_QNX) || \
+    defined(OS_SOLARIS) || defined(OS_ZOS)
+#define OS_POSIX 1
+#endif
+
+// OS build flags
+#if defined(OS_AIX)
+#define BUILDFLAG_INTERNAL_IS_AIX() (1)
+#else
+#define BUILDFLAG_INTERNAL_IS_AIX() (0)
+#endif
+
+#if defined(OS_ANDROID)
+#define BUILDFLAG_INTERNAL_IS_ANDROID() (1)
+#else
+#define BUILDFLAG_INTERNAL_IS_ANDROID() (0)
+#endif
+
+#if defined(OS_APPLE)
+#define BUILDFLAG_INTERNAL_IS_APPLE() (1)
+#else
+#define BUILDFLAG_INTERNAL_IS_APPLE() (0)
+#endif
+
+#if defined(OS_ASMJS)
+#define BUILDFLAG_INTERNAL_IS_ASMJS() (1)
+#else
+#define BUILDFLAG_INTERNAL_IS_ASMJS() (0)
+#endif
+
+#if defined(OS_BSD)
+#define BUILDFLAG_INTERNAL_IS_BSD() (1)
+#else
+#define BUILDFLAG_INTERNAL_IS_BSD() (0)
+#endif
+
+#if defined(OS_CHROMEOS)
+#define BUILDFLAG_INTERNAL_IS_CHROMEOS() (1)
+#else
+#define BUILDFLAG_INTERNAL_IS_CHROMEOS() (0)
+#endif
+
+#if defined(OS_FREEBSD)
+#define BUILDFLAG_INTERNAL_IS_FREEBSD() (1)
+#else
+#define BUILDFLAG_INTERNAL_IS_FREEBSD() (0)
+#endif
+
+#if defined(OS_FUCHSIA)
+#define BUILDFLAG_INTERNAL_IS_FUCHSIA() (1)
+#else
+#define BUILDFLAG_INTERNAL_IS_FUCHSIA() (0)
+#endif
+
+#if defined(OS_IOS)
+#define BUILDFLAG_INTERNAL_IS_IOS() (1)
+#else
+#define BUILDFLAG_INTERNAL_IS_IOS() (0)
+#endif
+
+#if defined(OS_LINUX)
+#define BUILDFLAG_INTERNAL_IS_LINUX() (1)
+#else
+#define BUILDFLAG_INTERNAL_IS_LINUX() (0)
+#endif
+
+#if defined(OS_MAC)
+#define BUILDFLAG_INTERNAL_IS_MAC() (1)
+#else
+#define BUILDFLAG_INTERNAL_IS_MAC() (0)
+#endif
+
+#if defined(OS_NACL)
+#define BUILDFLAG_INTERNAL_IS_NACL() (1)
+#else
+#define BUILDFLAG_INTERNAL_IS_NACL() (0)
+#endif
+
+#if defined(OS_NETBSD)
+#define BUILDFLAG_INTERNAL_IS_NETBSD() (1)
+#else
+#define BUILDFLAG_INTERNAL_IS_NETBSD() (0)
+#endif
+
+#if defined(OS_OPENBSD)
+#define BUILDFLAG_INTERNAL_IS_OPENBSD() (1)
+#else
+#define BUILDFLAG_INTERNAL_IS_OPENBSD() (0)
+#endif
+
+#if defined(OS_POSIX)
+#define BUILDFLAG_INTERNAL_IS_POSIX() (1)
+#else
+#define BUILDFLAG_INTERNAL_IS_POSIX() (0)
+#endif
+
+#if defined(OS_QNX)
+#define BUILDFLAG_INTERNAL_IS_QNX() (1)
+#else
+#define BUILDFLAG_INTERNAL_IS_QNX() (0)
+#endif
+
+#if defined(OS_SOLARIS)
+#define BUILDFLAG_INTERNAL_IS_SOLARIS() (1)
+#else
+#define BUILDFLAG_INTERNAL_IS_SOLARIS() (0)
+#endif
+
+#if defined(OS_WIN)
+#define BUILDFLAG_INTERNAL_IS_WIN() (1)
+#else
+#define BUILDFLAG_INTERNAL_IS_WIN() (0)
+#endif
+
+// Compiler detection. Note: clang masquerades as GCC on POSIX and as MSVC on
+// Windows.
+#if defined(__GNUC__)
+#define COMPILER_GCC 1
+#elif defined(_MSC_VER)
+#define COMPILER_MSVC 1
+#else
+#error Please add support for your compiler in build/build_config.h
+#endif
+
+// Processor architecture detection.  For more info on what's defined, see:
+//   http://msdn.microsoft.com/en-us/library/b0084kay.aspx
+//   http://www.agner.org/optimize/calling_conventions.pdf
+//   or with gcc, run: "echo | gcc -E -dM -"
+#if defined(_M_X64) || defined(__x86_64__)
+#define ARCH_CPU_X86_FAMILY 1
+#define ARCH_CPU_X86_64 1
+#define ARCH_CPU_64_BITS 1
+#define ARCH_CPU_LITTLE_ENDIAN 1
+#elif defined(_M_IX86) || defined(__i386__)
+#define ARCH_CPU_X86_FAMILY 1
+#define ARCH_CPU_X86 1
+#define ARCH_CPU_32_BITS 1
+#define ARCH_CPU_LITTLE_ENDIAN 1
+#elif defined(__s390x__)
+#define ARCH_CPU_S390_FAMILY 1
+#define ARCH_CPU_S390X 1
+#define ARCH_CPU_64_BITS 1
+#define ARCH_CPU_BIG_ENDIAN 1
+#elif defined(__s390__)
+#define ARCH_CPU_S390_FAMILY 1
+#define ARCH_CPU_S390 1
+#define ARCH_CPU_31_BITS 1
+#define ARCH_CPU_BIG_ENDIAN 1
+#elif (defined(__PPC64__) || defined(__PPC__)) && defined(__BIG_ENDIAN__)
+#define ARCH_CPU_PPC64_FAMILY 1
+#define ARCH_CPU_PPC64 1
+#define ARCH_CPU_64_BITS 1
+#define ARCH_CPU_BIG_ENDIAN 1
+#elif defined(__PPC64__)
+#define ARCH_CPU_PPC64_FAMILY 1
+#define ARCH_CPU_PPC64 1
+#define ARCH_CPU_64_BITS 1
+#define ARCH_CPU_LITTLE_ENDIAN 1
+#elif defined(__ARMEL__)
+#define ARCH_CPU_ARM_FAMILY 1
+#define ARCH_CPU_ARMEL 1
+#define ARCH_CPU_32_BITS 1
+#define ARCH_CPU_LITTLE_ENDIAN 1
+#elif defined(__aarch64__) || defined(_M_ARM64)
+#define ARCH_CPU_ARM_FAMILY 1
+#define ARCH_CPU_ARM64 1
+#define ARCH_CPU_64_BITS 1
+#define ARCH_CPU_LITTLE_ENDIAN 1
+#elif defined(__pnacl__) || defined(__asmjs__) || defined(__wasm__)
+#define ARCH_CPU_32_BITS 1
+#define ARCH_CPU_LITTLE_ENDIAN 1
+#elif defined(__MIPSEL__)
+#if defined(__LP64__)
+#define ARCH_CPU_MIPS_FAMILY 1
+#define ARCH_CPU_MIPS64EL 1
+#define ARCH_CPU_64_BITS 1
+#define ARCH_CPU_LITTLE_ENDIAN 1
+#else
+#define ARCH_CPU_MIPS_FAMILY 1
+#define ARCH_CPU_MIPSEL 1
+#define ARCH_CPU_32_BITS 1
+#define ARCH_CPU_LITTLE_ENDIAN 1
+#endif
+#elif defined(__MIPSEB__)
+#if defined(__LP64__)
+#define ARCH_CPU_MIPS_FAMILY 1
+#define ARCH_CPU_MIPS64 1
+#define ARCH_CPU_64_BITS 1
+#define ARCH_CPU_BIG_ENDIAN 1
+#else
+#define ARCH_CPU_MIPS_FAMILY 1
+#define ARCH_CPU_MIPS 1
+#define ARCH_CPU_32_BITS 1
+#define ARCH_CPU_BIG_ENDIAN 1
+#endif
+#elif defined(__loongarch32)
+#define ARCH_CPU_LOONG_FAMILY 1
+#define ARCH_CPU_LOONG32 1
+#define ARCH_CPU_32_BITS 1
+#define ARCH_CPU_LITTLE_ENDIAN 1
+#elif defined(__loongarch64)
+#define ARCH_CPU_LOONG_FAMILY 1
+#define ARCH_CPU_LOONG64 1
+#define ARCH_CPU_64_BITS 1
+#define ARCH_CPU_LITTLE_ENDIAN 1
+#elif defined(__riscv) && (__riscv_xlen == 64)
+#define ARCH_CPU_RISCV_FAMILY 1
+#define ARCH_CPU_RISCV64 1
+#define ARCH_CPU_64_BITS 1
+#define ARCH_CPU_LITTLE_ENDIAN 1
+#else
+#error Please add support for your architecture in build/build_config.h
+#endif
+
+// Type detection for wchar_t.
+#if defined(OS_WIN)
+#define WCHAR_T_IS_UTF16
+#elif defined(OS_FUCHSIA)
+#define WCHAR_T_IS_UTF32
+#elif defined(OS_POSIX) && defined(COMPILER_GCC) && defined(__WCHAR_MAX__) && \
+    (__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff)
+#define WCHAR_T_IS_UTF32
+#elif defined(OS_POSIX) && defined(COMPILER_GCC) && defined(__WCHAR_MAX__) && \
+    (__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff)
+// On Posix, we'll detect short wchar_t, but projects aren't guaranteed to
+// compile in this mode (in particular, Chrome doesn't). This is intended for
+// other projects using base who manage their own dependencies and make sure
+// short wchar works for them.
+#define WCHAR_T_IS_UTF16
+#else
+#error Please add support for your compiler in build/build_config.h
+#endif
+
+#if defined(OS_ANDROID)
+// The compiler thinks std::string::const_iterator and "const char*" are
+// equivalent types.
+#define STD_STRING_ITERATOR_IS_CHAR_POINTER
+// The compiler thinks std::u16string::const_iterator and "char16*" are
+// equivalent types.
+#define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER
+#endif
+
+#endif  // BUILD_BUILD_CONFIG_H_
diff --git a/build/buildflag.h b/build/buildflag.h
new file mode 100644
index 0000000000..5776a754c4
--- /dev/null
+++ b/build/buildflag.h
@@ -0,0 +1,47 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BUILD_BUILDFLAG_H_
+#define BUILD_BUILDFLAG_H_
+
+// These macros un-mangle the names of the build flags in a way that looks
+// natural, and gives errors if the flag is not defined. Normally in the
+// preprocessor it's easy to make mistakes that interpret "you haven't done
+// the setup to know what the flag is" as "flag is off". Normally you would
+// include the generated header rather than include this file directly.
+//
+// This is for use with generated headers. See build/buildflag_header.gni.
+
+// This dance of two macros does a concatenation of two preprocessor args using
+// ## doubly indirectly because using ## directly prevents macros in that
+// parameter from being expanded.
+#define BUILDFLAG_CAT_INDIRECT(a, b) a ## b
+#define BUILDFLAG_CAT(a, b) BUILDFLAG_CAT_INDIRECT(a, b)
+
+// Accessor for build flags.
+//
+// To test for a value, if the build file specifies:
+//
+//   ENABLE_FOO=true
+//
+// Then you would check at build-time in source code with:
+//
+//   #include "foo_flags.h"  // The header the build file specified.
+//
+//   #if BUILDFLAG(ENABLE_FOO)
+//     ...
+//   #endif
+//
+// There will no #define called ENABLE_FOO so if you accidentally test for
+// whether that is defined, it will always be negative. You can also use
+// the value in expressions:
+//
+//   const char kSpamServerName[] = BUILDFLAG(SPAM_SERVER_NAME);
+//
+// Because the flag is accessed as a preprocessor macro with (), an error
+// will be thrown if the proper header defining the internal flag value has
+// not been included.
+#define BUILDFLAG(flag) (BUILDFLAG_CAT(BUILDFLAG_INTERNAL_, flag)())
+
+#endif  // BUILD_BUILDFLAG_H_
diff --git a/core/fpdfapi/font/cfx_cttgsubtable.h b/core/fpdfapi/font/cfx_cttgsubtable.h
index 6a1d5ce143..ea85e83b7d 100644
--- a/core/fpdfapi/font/cfx_cttgsubtable.h
+++ b/core/fpdfapi/font/cfx_cttgsubtable.h
@@ -15,7 +15,7 @@
 
 #include "core/fxcrt/fx_memory_wrappers.h"
 #include "core/fxge/fx_freetype.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CFX_CTTGSUBTable {
  public:
diff --git a/core/fpdfapi/font/cpdf_cmap.cpp b/core/fpdfapi/font/cpdf_cmap.cpp
index 8e93bae955..bd8c927d2f 100644
--- a/core/fpdfapi/font/cpdf_cmap.cpp
+++ b/core/fpdfapi/font/cpdf_cmap.cpp
@@ -4,12 +4,12 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "core/fpdfapi/font/cpdf_cmap.h"
+//#include "core/fpdfapi/font/cpdf_cmap.h"
 
 #include <utility>
 #include <vector>
 
-#include "core/fpdfapi/cmaps/fpdf_cmaps.h"
+//#include "core/fpdfapi/cmaps/fpdf_cmaps.h"
 #include "core/fpdfapi/font/cpdf_cmapparser.h"
 #include "core/fpdfapi/font/cpdf_fontglobals.h"
 #include "core/fpdfapi/parser/cpdf_simple_parser.h"
diff --git a/core/fpdfapi/font/cpdf_cmapparser.h b/core/fpdfapi/font/cpdf_cmapparser.h
index eb64c1f651..ace34527b0 100644
--- a/core/fpdfapi/font/cpdf_cmapparser.h
+++ b/core/fpdfapi/font/cpdf_cmapparser.h
@@ -13,7 +13,7 @@
 #include "core/fpdfapi/font/cpdf_cidfont.h"
 #include "core/fpdfapi/font/cpdf_cmap.h"
 #include "core/fxcrt/unowned_ptr.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CPDF_CMapParser {
  public:
diff --git a/core/fpdfapi/font/cpdf_fontglobals.cpp b/core/fpdfapi/font/cpdf_fontglobals.cpp
index c3065b9357..a27d2a2c19 100644
--- a/core/fpdfapi/font/cpdf_fontglobals.cpp
+++ b/core/fpdfapi/font/cpdf_fontglobals.cpp
@@ -48,10 +48,10 @@ CPDF_FontGlobals::CPDF_FontGlobals() {
 CPDF_FontGlobals::~CPDF_FontGlobals() = default;
 
 void CPDF_FontGlobals::LoadEmbeddedMaps() {
-  LoadEmbeddedGB1CMaps();
-  LoadEmbeddedCNS1CMaps();
-  LoadEmbeddedJapan1CMaps();
-  LoadEmbeddedKorea1CMaps();
+  //LoadEmbeddedGB1CMaps();
+  //LoadEmbeddedCNS1CMaps();
+  //LoadEmbeddedJapan1CMaps();
+  //LoadEmbeddedKorea1CMaps();
 }
 
 RetainPtr<CPDF_Font> CPDF_FontGlobals::Find(
@@ -77,27 +77,27 @@ void CPDF_FontGlobals::Clear(CPDF_Document* pDoc) {
 }
 
 void CPDF_FontGlobals::LoadEmbeddedGB1CMaps() {
-  SetEmbeddedCharset(
-      CIDSET_GB1, pdfium::make_span(kFXCMAP_GB1_cmaps, kFXCMAP_GB1_cmaps_size));
-  SetEmbeddedToUnicode(CIDSET_GB1, kFXCMAP_GB1CID2Unicode_5);
+  //SetEmbeddedCharset(
+  //    CIDSET_GB1, pdfium::make_span(kFXCMAP_GB1_cmaps, kFXCMAP_GB1_cmaps_size));
+  //SetEmbeddedToUnicode(CIDSET_GB1, kFXCMAP_GB1CID2Unicode_5);
 }
 
 void CPDF_FontGlobals::LoadEmbeddedCNS1CMaps() {
-  SetEmbeddedCharset(CIDSET_CNS1, pdfium::make_span(kFXCMAP_CNS1_cmaps,
-                                                    kFXCMAP_CNS1_cmaps_size));
-  SetEmbeddedToUnicode(CIDSET_CNS1, kFXCMAP_CNS1CID2Unicode_5);
+  //SetEmbeddedCharset(CIDSET_CNS1, pdfium::make_span(kFXCMAP_CNS1_cmaps,
+  //                                                  kFXCMAP_CNS1_cmaps_size));
+  //SetEmbeddedToUnicode(CIDSET_CNS1, kFXCMAP_CNS1CID2Unicode_5);
 }
 
 void CPDF_FontGlobals::LoadEmbeddedJapan1CMaps() {
-  SetEmbeddedCharset(
-      CIDSET_JAPAN1,
-      pdfium::make_span(kFXCMAP_Japan1_cmaps, kFXCMAP_Japan1_cmaps_size));
-  SetEmbeddedToUnicode(CIDSET_JAPAN1, kFXCMAP_Japan1CID2Unicode_4);
+  //SetEmbeddedCharset(
+  //    CIDSET_JAPAN1,
+  //    pdfium::make_span(kFXCMAP_Japan1_cmaps, kFXCMAP_Japan1_cmaps_size));
+  //SetEmbeddedToUnicode(CIDSET_JAPAN1, kFXCMAP_Japan1CID2Unicode_4);
 }
 
 void CPDF_FontGlobals::LoadEmbeddedKorea1CMaps() {
-  SetEmbeddedCharset(
-      CIDSET_KOREA1,
-      pdfium::make_span(kFXCMAP_Korea1_cmaps, kFXCMAP_Korea1_cmaps_size));
-  SetEmbeddedToUnicode(CIDSET_KOREA1, kFXCMAP_Korea1CID2Unicode_2);
+  //SetEmbeddedCharset(
+  //    CIDSET_KOREA1,
+  //    pdfium::make_span(kFXCMAP_Korea1_cmaps, kFXCMAP_Korea1_cmaps_size));
+  //SetEmbeddedToUnicode(CIDSET_KOREA1, kFXCMAP_Korea1CID2Unicode_2);
 }
diff --git a/core/fpdfapi/font/cpdf_tounicodemap.h b/core/fpdfapi/font/cpdf_tounicodemap.h
index 106bb004db..6bad87bea0 100644
--- a/core/fpdfapi/font/cpdf_tounicodemap.h
+++ b/core/fpdfapi/font/cpdf_tounicodemap.h
@@ -12,7 +12,7 @@
 
 #include "core/fxcrt/fx_string.h"
 #include "core/fxcrt/unowned_ptr.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CPDF_CID2UnicodeMap;
 class CPDF_SimpleParser;
diff --git a/core/fpdfapi/font/cpdf_type3char.h b/core/fpdfapi/font/cpdf_type3char.h
index e7576982db..af28fc080c 100644
--- a/core/fpdfapi/font/cpdf_type3char.h
+++ b/core/fpdfapi/font/cpdf_type3char.h
@@ -13,7 +13,7 @@
 #include "core/fpdfapi/font/cpdf_font.h"
 #include "core/fxcrt/fx_coordinates.h"
 #include "core/fxcrt/retain_ptr.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/span.h"
 
 class CFX_DIBitmap;
diff --git a/core/fpdfapi/page/cpdf_dib.cpp b/core/fpdfapi/page/cpdf_dib.cpp
index d6211980d9..ad64ea8131 100644
--- a/core/fpdfapi/page/cpdf_dib.cpp
+++ b/core/fpdfapi/page/cpdf_dib.cpp
@@ -26,9 +26,9 @@
 #include "core/fpdfapi/parser/fpdf_parser_decode.h"
 #include "core/fpdfapi/parser/fpdf_parser_utility.h"
 #include "core/fxcodec/basic/basicmodule.h"
-#include "core/fxcodec/jbig2/jbig2_decoder.h"
-#include "core/fxcodec/jpeg/jpegmodule.h"
-#include "core/fxcodec/jpx/cjpx_decoder.h"
+//#include "core/fxcodec/jbig2/jbig2_decoder.h"
+//#include "core/fxcodec/jpeg/jpegmodule.h"
+//#include "core/fxcodec/jpx/cjpx_decoder.h"
 #include "core/fxcodec/scanlinedecoder.h"
 #include "core/fxcrt/cfx_fixedbufgrow.h"
 #include "core/fxcrt/fx_safe_types.h"
@@ -96,14 +96,14 @@ int CalculateBitsPerPixel(uint32_t bpc, uint32_t comps) {
   return 24;
 }
 
-CJPX_Decoder::ColorSpaceOption ColorSpaceOptionFromColorSpace(
-    CPDF_ColorSpace* pCS) {
-  if (!pCS)
-    return CJPX_Decoder::kNoColorSpace;
-  if (pCS->GetFamily() == CPDF_ColorSpace::Family::kIndexed)
-    return CJPX_Decoder::kIndexedColorSpace;
-  return CJPX_Decoder::kNormalColorSpace;
-}
+//CJPX_Decoder::ColorSpaceOption ColorSpaceOptionFromColorSpace(
+//    CPDF_ColorSpace* pCS) {
+//  if (!pCS)
+//    return CJPX_Decoder::kNoColorSpace;
+//  if (pCS->GetFamily() == CPDF_ColorSpace::Family::kIndexed)
+//    return CJPX_Decoder::kIndexedColorSpace;
+//  return CJPX_Decoder::kNormalColorSpace;
+//}
 
 enum class JpxDecodeAction {
   kFail,
@@ -113,42 +113,42 @@ enum class JpxDecodeAction {
   kConvertArgbToRgb,
 };
 
-JpxDecodeAction GetJpxDecodeAction(const CJPX_Decoder::JpxImageInfo& jpx_info,
-                                   const CPDF_ColorSpace* pdf_colorspace) {
-  if (pdf_colorspace) {
-    // Make sure the JPX image and the PDF colorspace agree on the number of
-    // components. In case of a mismatch, try to handle the discrepancy.
-    if (jpx_info.components != pdf_colorspace->CountComponents()) {
-      // Many PDFs generated by iOS meets this condition. See
-      // https://crbug.com/1012369 for example.
-      if (pdf_colorspace->CountComponents() == 3 && jpx_info.components == 4 &&
-          jpx_info.colorspace == OPJ_CLRSPC_SRGB) {
-        return JpxDecodeAction::kConvertArgbToRgb;
-      }
-
-      return JpxDecodeAction::kFail;
-    }
-
-    if (pdf_colorspace ==
-        CPDF_ColorSpace::GetStockCS(CPDF_ColorSpace::Family::kDeviceRGB)) {
-      return JpxDecodeAction::kUseRgb;
-    }
-    return JpxDecodeAction::kDoNothing;
-  }
-
-  // Cases where the PDF did not provide a colorspace.
-  // Choose how to decode based on the number of components in the JPX image.
-  switch (jpx_info.components) {
-    case 3:
-      return JpxDecodeAction::kUseRgb;
-
-    case 4:
-      return JpxDecodeAction::kUseCmyk;
-
-    default:
-      return JpxDecodeAction::kDoNothing;
-  }
-}
+//JpxDecodeAction GetJpxDecodeAction(const CJPX_Decoder::JpxImageInfo& jpx_info,
+//                                   const CPDF_ColorSpace* pdf_colorspace) {
+//  if (pdf_colorspace) {
+//    // Make sure the JPX image and the PDF colorspace agree on the number of
+//    // components. In case of a mismatch, try to handle the discrepancy.
+//    if (jpx_info.components != pdf_colorspace->CountComponents()) {
+//      // Many PDFs generated by iOS meets this condition. See
+//      // https://crbug.com/1012369 for example.
+//      if (pdf_colorspace->CountComponents() == 3 && jpx_info.components == 4 &&
+//          jpx_info.colorspace == OPJ_CLRSPC_SRGB) {
+//        return JpxDecodeAction::kConvertArgbToRgb;
+//      }
+//
+//      return JpxDecodeAction::kFail;
+//    }
+//
+//    if (pdf_colorspace ==
+//        CPDF_ColorSpace::GetStockCS(CPDF_ColorSpace::Family::kDeviceRGB)) {
+//      return JpxDecodeAction::kUseRgb;
+//    }
+//    return JpxDecodeAction::kDoNothing;
+//  }
+//
+//  // Cases where the PDF did not provide a colorspace.
+//  // Choose how to decode based on the number of components in the JPX image.
+//  switch (jpx_info.components) {
+//    case 3:
+//      return JpxDecodeAction::kUseRgb;
+//
+//    case 4:
+//      return JpxDecodeAction::kUseCmyk;
+//
+//    default:
+//      return JpxDecodeAction::kDoNothing;
+//  }
+//}
 
 }  // namespace
 
@@ -323,74 +323,75 @@ CPDF_DIB::LoadState CPDF_DIB::StartLoadDIBBase(
 }
 
 CPDF_DIB::LoadState CPDF_DIB::ContinueLoadDIBBase(PauseIndicatorIface* pPause) {
-  if (m_Status == LoadState::kContinue)
-    return ContinueLoadMaskDIB(pPause);
-
-  ByteString decoder = m_pStreamAcc->GetImageDecoder();
-  if (decoder == "JPXDecode")
-    return LoadState::kFail;
-
-  if (decoder != "JBIG2Decode")
-    return LoadState::kSuccess;
-
-  if (m_Status == LoadState::kFail)
-    return LoadState::kFail;
-
-  FXCODEC_STATUS iDecodeStatus;
-  if (!m_pJbig2Context) {
-    m_pJbig2Context = std::make_unique<Jbig2Context>();
-    if (m_pStreamAcc->GetImageParam()) {
-      const CPDF_Stream* pGlobals =
-          m_pStreamAcc->GetImageParam()->GetStreamFor("JBIG2Globals");
-      if (pGlobals) {
-        m_pGlobalAcc = pdfium::MakeRetain<CPDF_StreamAcc>(pGlobals);
-        m_pGlobalAcc->LoadAllDataFiltered();
-      }
-    }
-    uint64_t nSrcKey = 0;
-    pdfium::span<const uint8_t> pSrcSpan;
-    if (m_pStreamAcc) {
-      pSrcSpan = m_pStreamAcc->GetSpan();
-      if (m_pStreamAcc->GetStream())
-        nSrcKey = m_pStreamAcc->GetStream()->KeyForCache();
-    }
-    uint64_t nGlobalKey = 0;
-    pdfium::span<const uint8_t> pGlobalSpan;
-    if (m_pGlobalAcc) {
-      pGlobalSpan = m_pGlobalAcc->GetSpan();
-      if (m_pGlobalAcc->GetStream())
-        nGlobalKey = m_pGlobalAcc->GetStream()->KeyForCache();
-    }
-    iDecodeStatus = Jbig2Decoder::StartDecode(
-        m_pJbig2Context.get(), m_pDocument->GetOrCreateCodecContext(), m_Width,
-        m_Height, pSrcSpan, nSrcKey, pGlobalSpan, nGlobalKey,
-        m_pCachedBitmap->GetBuffer(), m_pCachedBitmap->GetPitch(), pPause);
-  } else {
-    iDecodeStatus = Jbig2Decoder::ContinueDecode(m_pJbig2Context.get(), pPause);
-  }
-
-  if (iDecodeStatus == FXCODEC_STATUS::kError) {
-    m_pJbig2Context.reset();
-    m_pCachedBitmap.Reset();
-    m_pGlobalAcc.Reset();
-    return LoadState::kFail;
-  }
-  if (iDecodeStatus == FXCODEC_STATUS::kDecodeToBeContinued)
-    return LoadState::kContinue;
-
-  LoadState iContinueStatus = LoadState::kSuccess;
-  if (m_bHasMask) {
-    if (ContinueLoadMaskDIB(pPause) == LoadState::kContinue) {
-      iContinueStatus = LoadState::kContinue;
-      m_Status = LoadState::kContinue;
-    }
-  }
-  if (iContinueStatus == LoadState::kContinue)
-    return LoadState::kContinue;
-
-  if (m_pColorSpace && m_bStdCS)
-    m_pColorSpace->EnableStdConversion(false);
-  return iContinueStatus;
+  return LoadState::kFail;
+  //if (m_Status == LoadState::kContinue)
+  //  return ContinueLoadMaskDIB(pPause);
+
+  //ByteString decoder = m_pStreamAcc->GetImageDecoder();
+  //if (decoder == "JPXDecode")
+  //  return LoadState::kFail;
+
+  //if (decoder != "JBIG2Decode")
+  //  return LoadState::kSuccess;
+
+  //if (m_Status == LoadState::kFail)
+  //  return LoadState::kFail;
+
+  //FXCODEC_STATUS iDecodeStatus;
+  //if (!m_pJbig2Context) {
+  //  m_pJbig2Context = std::make_unique<Jbig2Context>();
+  //  if (m_pStreamAcc->GetImageParam()) {
+  //    const CPDF_Stream* pGlobals =
+  //        m_pStreamAcc->GetImageParam()->GetStreamFor("JBIG2Globals");
+  //    if (pGlobals) {
+  //      m_pGlobalAcc = pdfium::MakeRetain<CPDF_StreamAcc>(pGlobals);
+  //      m_pGlobalAcc->LoadAllDataFiltered();
+  //    }
+  //  }
+  //  uint64_t nSrcKey = 0;
+  //  pdfium::span<const uint8_t> pSrcSpan;
+  //  if (m_pStreamAcc) {
+  //    pSrcSpan = m_pStreamAcc->GetSpan();
+  //    if (m_pStreamAcc->GetStream())
+  //      nSrcKey = m_pStreamAcc->GetStream()->KeyForCache();
+  //  }
+  //  uint64_t nGlobalKey = 0;
+  //  pdfium::span<const uint8_t> pGlobalSpan;
+  //  if (m_pGlobalAcc) {
+  //    pGlobalSpan = m_pGlobalAcc->GetSpan();
+  //    if (m_pGlobalAcc->GetStream())
+  //      nGlobalKey = m_pGlobalAcc->GetStream()->KeyForCache();
+  //  }
+  //  iDecodeStatus = Jbig2Decoder::StartDecode(
+  //      m_pJbig2Context.get(), m_pDocument->GetOrCreateCodecContext(), m_Width,
+  //      m_Height, pSrcSpan, nSrcKey, pGlobalSpan, nGlobalKey,
+  //      m_pCachedBitmap->GetBuffer(), m_pCachedBitmap->GetPitch(), pPause);
+  //} else {
+  //  iDecodeStatus = Jbig2Decoder::ContinueDecode(m_pJbig2Context.get(), pPause);
+  //}
+
+  //if (iDecodeStatus == FXCODEC_STATUS::kError) {
+  //  m_pJbig2Context.reset();
+  //  m_pCachedBitmap.Reset();
+  //  m_pGlobalAcc.Reset();
+  //  return LoadState::kFail;
+  //}
+  //if (iDecodeStatus == FXCODEC_STATUS::kDecodeToBeContinued)
+  //  return LoadState::kContinue;
+
+  //LoadState iContinueStatus = LoadState::kSuccess;
+  //if (m_bHasMask) {
+  //  if (ContinueLoadMaskDIB(pPause) == LoadState::kContinue) {
+  //    iContinueStatus = LoadState::kContinue;
+  //    m_Status = LoadState::kContinue;
+  //  }
+  //}
+  //if (iContinueStatus == LoadState::kContinue)
+  //  return LoadState::kContinue;
+
+  //if (m_pColorSpace && m_bStdCS)
+  //  m_pColorSpace->EnableStdConversion(false);
+  //return iContinueStatus;
 }
 
 bool CPDF_DIB::LoadColorInfo(const CPDF_Dictionary* pFormResources,
@@ -566,210 +567,211 @@ CPDF_DIB::LoadState CPDF_DIB::CreateDecoder() {
 
 bool CPDF_DIB::CreateDCTDecoder(pdfium::span<const uint8_t> src_span,
                                 const CPDF_Dictionary* pParams) {
-  m_pDecoder = JpegModule::CreateDecoder(
-      src_span, m_Width, m_Height, m_nComponents,
-      !pParams || pParams->GetIntegerFor("ColorTransform", 1));
-  if (m_pDecoder)
-    return true;
-
-  absl::optional<JpegModule::ImageInfo> info_opt =
-      JpegModule::LoadInfo(src_span);
-  if (!info_opt.has_value())
-    return false;
-
-  const JpegModule::ImageInfo& info = info_opt.value();
-  m_Width = info.width;
-  m_Height = info.height;
-
-  if (!CPDF_Image::IsValidJpegComponent(info.num_components) ||
-      !CPDF_Image::IsValidJpegBitsPerComponent(info.bits_per_components)) {
-    return false;
-  }
-
-  if (m_nComponents == static_cast<uint32_t>(info.num_components)) {
-    m_bpc = info.bits_per_components;
-    m_pDecoder = JpegModule::CreateDecoder(src_span, m_Width, m_Height,
-                                           m_nComponents, info.color_transform);
-    return true;
-  }
-
-  m_nComponents = static_cast<uint32_t>(info.num_components);
-  m_CompData.clear();
-  if (m_pColorSpace) {
-    uint32_t colorspace_comps = m_pColorSpace->CountComponents();
-    switch (m_Family) {
-      case CPDF_ColorSpace::Family::kDeviceGray:
-      case CPDF_ColorSpace::Family::kDeviceRGB:
-      case CPDF_ColorSpace::Family::kDeviceCMYK: {
-        uint32_t dwMinComps = CPDF_ColorSpace::ComponentsForFamily(m_Family);
-        if (colorspace_comps < dwMinComps || m_nComponents < dwMinComps)
-          return false;
-        break;
-      }
-      case CPDF_ColorSpace::Family::kLab: {
-        if (m_nComponents != 3 || colorspace_comps < 3)
-          return false;
-        break;
-      }
-      case CPDF_ColorSpace::Family::kICCBased: {
-        if (!CPDF_ColorSpace::IsValidIccComponents(colorspace_comps) ||
-            !CPDF_ColorSpace::IsValidIccComponents(m_nComponents) ||
-            colorspace_comps < m_nComponents) {
-          return false;
-        }
-        break;
-      }
-      default: {
-        if (colorspace_comps != m_nComponents)
-          return false;
-        break;
-      }
-    }
-  } else {
-    if (m_Family == CPDF_ColorSpace::Family::kLab && m_nComponents != 3)
-      return false;
-  }
-  if (!GetDecodeAndMaskArray(&m_bDefaultDecode, &m_bColorKey))
-    return false;
-
-  m_bpc = info.bits_per_components;
-  m_pDecoder = JpegModule::CreateDecoder(src_span, m_Width, m_Height,
-                                         m_nComponents, info.color_transform);
-  return true;
+  return false;
+  //m_pDecoder = JpegModule::CreateDecoder(
+  //    src_span, m_Width, m_Height, m_nComponents,
+  //    !pParams || pParams->GetIntegerFor("ColorTransform", 1));
+  //if (m_pDecoder)
+  //  return true;
+
+  //absl::optional<JpegModule::ImageInfo> info_opt =
+  //    JpegModule::LoadInfo(src_span);
+  //if (!info_opt.has_value())
+  //  return false;
+
+  //const JpegModule::ImageInfo& info = info_opt.value();
+  //m_Width = info.width;
+  //m_Height = info.height;
+
+  //if (!CPDF_Image::IsValidJpegComponent(info.num_components) ||
+  //    !CPDF_Image::IsValidJpegBitsPerComponent(info.bits_per_components)) {
+  //  return false;
+  //}
+
+  //if (m_nComponents == static_cast<uint32_t>(info.num_components)) {
+  //  m_bpc = info.bits_per_components;
+  //  m_pDecoder = JpegModule::CreateDecoder(src_span, m_Width, m_Height,
+  //                                         m_nComponents, info.color_transform);
+  //  return true;
+  //}
+
+  //m_nComponents = static_cast<uint32_t>(info.num_components);
+  //m_CompData.clear();
+  //if (m_pColorSpace) {
+  //  uint32_t colorspace_comps = m_pColorSpace->CountComponents();
+  //  switch (m_Family) {
+  //    case CPDF_ColorSpace::Family::kDeviceGray:
+  //    case CPDF_ColorSpace::Family::kDeviceRGB:
+  //    case CPDF_ColorSpace::Family::kDeviceCMYK: {
+  //      uint32_t dwMinComps = CPDF_ColorSpace::ComponentsForFamily(m_Family);
+  //      if (colorspace_comps < dwMinComps || m_nComponents < dwMinComps)
+  //        return false;
+  //      break;
+  //    }
+  //    case CPDF_ColorSpace::Family::kLab: {
+  //      if (m_nComponents != 3 || colorspace_comps < 3)
+  //        return false;
+  //      break;
+  //    }
+  //    case CPDF_ColorSpace::Family::kICCBased: {
+  //      if (!CPDF_ColorSpace::IsValidIccComponents(colorspace_comps) ||
+  //          !CPDF_ColorSpace::IsValidIccComponents(m_nComponents) ||
+  //          colorspace_comps < m_nComponents) {
+  //        return false;
+  //      }
+  //      break;
+  //    }
+  //    default: {
+  //      if (colorspace_comps != m_nComponents)
+  //        return false;
+  //      break;
+  //    }
+  //  }
+  //} else {
+  //  if (m_Family == CPDF_ColorSpace::Family::kLab && m_nComponents != 3)
+  //    return false;
+  //}
+  //if (!GetDecodeAndMaskArray(&m_bDefaultDecode, &m_bColorKey))
+  //  return false;
+
+  //m_bpc = info.bits_per_components;
+  //m_pDecoder = JpegModule::CreateDecoder(src_span, m_Width, m_Height,
+  //                                       m_nComponents, info.color_transform);
+  //return true;
 }
 
 RetainPtr<CFX_DIBitmap> CPDF_DIB::LoadJpxBitmap() {
-  std::unique_ptr<CJPX_Decoder> decoder =
-      CJPX_Decoder::Create(m_pStreamAcc->GetSpan(),
-                           ColorSpaceOptionFromColorSpace(m_pColorSpace.Get()));
-  if (!decoder)
-    return nullptr;
-
-  if (!decoder->StartDecode())
+  //std::unique_ptr<CJPX_Decoder> decoder =
+  //    CJPX_Decoder::Create(m_pStreamAcc->GetSpan(),
+  //                         ColorSpaceOptionFromColorSpace(m_pColorSpace.Get()));
+  //if (!decoder)
     return nullptr;
 
-  CJPX_Decoder::JpxImageInfo image_info = decoder->GetInfo();
-  if (static_cast<int>(image_info.width) < m_Width ||
-      static_cast<int>(image_info.height) < m_Height) {
-    return nullptr;
-  }
-
-  RetainPtr<CPDF_ColorSpace> original_colorspace = m_pColorSpace;
-  bool swap_rgb = false;
-  bool convert_argb_to_rgb = false;
-  switch (GetJpxDecodeAction(image_info, m_pColorSpace.Get())) {
-    case JpxDecodeAction::kFail:
-      return nullptr;
-
-    case JpxDecodeAction::kDoNothing:
-      break;
-
-    case JpxDecodeAction::kUseRgb:
-      DCHECK(image_info.components >= 3);
-      swap_rgb = true;
-      m_pColorSpace = nullptr;
-      break;
-
-    case JpxDecodeAction::kUseCmyk:
-      m_pColorSpace =
-          CPDF_ColorSpace::GetStockCS(CPDF_ColorSpace::Family::kDeviceCMYK);
-      break;
-
-    case JpxDecodeAction::kConvertArgbToRgb:
-      swap_rgb = true;
-      convert_argb_to_rgb = true;
-      m_pColorSpace.Reset();
-  }
-
-  // If |original_colorspace| exists, then LoadColorInfo() already set
-  // |m_nComponents|.
-  if (original_colorspace) {
-    DCHECK_NE(0, m_nComponents);
-  } else {
-    DCHECK_EQ(0, m_nComponents);
-    m_nComponents = image_info.components;
-  }
-
-  FXDIB_Format format;
-  if (image_info.components == 1) {
-    format = FXDIB_Format::k8bppRgb;
-  } else if (image_info.components <= 3) {
-    format = FXDIB_Format::kRgb;
-  } else if (image_info.components == 4) {
-    format = FXDIB_Format::kRgb32;
-  } else {
-    image_info.width = (image_info.width * image_info.components + 2) / 3;
-    format = FXDIB_Format::kRgb;
-  }
-
-  auto result_bitmap = pdfium::MakeRetain<CFX_DIBitmap>();
-  if (!result_bitmap->Create(image_info.width, image_info.height, format))
-    return nullptr;
-
-  result_bitmap->Clear(0xFFFFFFFF);
-  if (!decoder->Decode(result_bitmap->GetBuffer(), result_bitmap->GetPitch(),
-                       swap_rgb)) {
-    return nullptr;
-  }
-
-  if (convert_argb_to_rgb) {
-    DCHECK_EQ(3, m_nComponents);
-    auto rgb_bitmap = pdfium::MakeRetain<CFX_DIBitmap>();
-    if (!rgb_bitmap->Create(image_info.width, image_info.height,
-                            FXDIB_Format::kRgb)) {
-      return nullptr;
-    }
-    if (m_pDict->GetIntegerFor("SMaskInData") == 1) {
-      // TODO(thestig): Acrobat does not support "/SMaskInData 1" combined with
-      // filters. Check for that and fail early.
-      DCHECK(m_JpxInlineData.data.empty());
-      m_JpxInlineData.width = image_info.width;
-      m_JpxInlineData.height = image_info.height;
-      m_JpxInlineData.data.reserve(image_info.width * image_info.height);
-      for (uint32_t row = 0; row < image_info.height; ++row) {
-        const uint8_t* src = result_bitmap->GetScanline(row).data();
-        uint8_t* dest = rgb_bitmap->GetWritableScanline(row).data();
-        for (uint32_t col = 0; col < image_info.width; ++col) {
-          uint8_t a = src[3];
-          m_JpxInlineData.data.push_back(a);
-          uint8_t na = 255 - a;
-          uint8_t b = (src[0] * a + 255 * na) / 255;
-          uint8_t g = (src[1] * a + 255 * na) / 255;
-          uint8_t r = (src[2] * a + 255 * na) / 255;
-          dest[0] = b;
-          dest[1] = g;
-          dest[2] = r;
-          src += 4;
-          dest += 3;
-        }
-      }
-    } else {
-      // TODO(thestig): Is there existing code that does this already?
-      for (uint32_t row = 0; row < image_info.height; ++row) {
-        const uint8_t* src = result_bitmap->GetScanline(row).data();
-        uint8_t* dest = rgb_bitmap->GetWritableScanline(row).data();
-        for (uint32_t col = 0; col < image_info.width; ++col) {
-          memcpy(dest, src, 3);
-          src += 4;
-          dest += 3;
-        }
-      }
-    }
-    result_bitmap = std::move(rgb_bitmap);
-  } else if (m_pColorSpace &&
-             m_pColorSpace->GetFamily() == CPDF_ColorSpace::Family::kIndexed &&
-             m_bpc < 8) {
-    int scale = 8 - m_bpc;
-    for (uint32_t row = 0; row < image_info.height; ++row) {
-      uint8_t* scanline = result_bitmap->GetWritableScanline(row).data();
-      for (uint32_t col = 0; col < image_info.width; ++col) {
-        *scanline = (*scanline) >> scale;
-        ++scanline;
-      }
-    }
-  }
-  m_bpc = 8;
-  return result_bitmap;
+  //if (!decoder->StartDecode())
+  //  return nullptr;
+
+  //CJPX_Decoder::JpxImageInfo image_info = decoder->GetInfo();
+  //if (static_cast<int>(image_info.width) < m_Width ||
+  //    static_cast<int>(image_info.height) < m_Height) {
+  //  return nullptr;
+  //}
+
+  //RetainPtr<CPDF_ColorSpace> original_colorspace = m_pColorSpace;
+  //bool swap_rgb = false;
+  //bool convert_argb_to_rgb = false;
+  //switch (GetJpxDecodeAction(image_info, m_pColorSpace.Get())) {
+  //  case JpxDecodeAction::kFail:
+  //    return nullptr;
+
+  //  case JpxDecodeAction::kDoNothing:
+  //    break;
+
+  //  case JpxDecodeAction::kUseRgb:
+  //    DCHECK(image_info.components >= 3);
+  //    swap_rgb = true;
+  //    m_pColorSpace = nullptr;
+  //    break;
+
+  //  case JpxDecodeAction::kUseCmyk:
+  //    m_pColorSpace =
+  //        CPDF_ColorSpace::GetStockCS(CPDF_ColorSpace::Family::kDeviceCMYK);
+  //    break;
+
+  //  case JpxDecodeAction::kConvertArgbToRgb:
+  //    swap_rgb = true;
+  //    convert_argb_to_rgb = true;
+  //    m_pColorSpace.Reset();
+  //}
+
+  //// If |original_colorspace| exists, then LoadColorInfo() already set
+  //// |m_nComponents|.
+  //if (original_colorspace) {
+  //  DCHECK_NE(0, m_nComponents);
+  //} else {
+  //  DCHECK_EQ(0, m_nComponents);
+  //  m_nComponents = image_info.components;
+  //}
+
+  //FXDIB_Format format;
+  //if (image_info.components == 1) {
+  //  format = FXDIB_Format::k8bppRgb;
+  //} else if (image_info.components <= 3) {
+  //  format = FXDIB_Format::kRgb;
+  //} else if (image_info.components == 4) {
+  //  format = FXDIB_Format::kRgb32;
+  //} else {
+  //  image_info.width = (image_info.width * image_info.components + 2) / 3;
+  //  format = FXDIB_Format::kRgb;
+  //}
+
+  //auto result_bitmap = pdfium::MakeRetain<CFX_DIBitmap>();
+  //if (!result_bitmap->Create(image_info.width, image_info.height, format))
+  //  return nullptr;
+
+  //result_bitmap->Clear(0xFFFFFFFF);
+  //if (!decoder->Decode(result_bitmap->GetBuffer(), result_bitmap->GetPitch(),
+  //                     swap_rgb)) {
+  //  return nullptr;
+  //}
+
+  //if (convert_argb_to_rgb) {
+  //  DCHECK_EQ(3, m_nComponents);
+  //  auto rgb_bitmap = pdfium::MakeRetain<CFX_DIBitmap>();
+  //  if (!rgb_bitmap->Create(image_info.width, image_info.height,
+  //                          FXDIB_Format::kRgb)) {
+  //    return nullptr;
+  //  }
+  //  if (m_pDict->GetIntegerFor("SMaskInData") == 1) {
+  //    // TODO(thestig): Acrobat does not support "/SMaskInData 1" combined with
+  //    // filters. Check for that and fail early.
+  //    DCHECK(m_JpxInlineData.data.empty());
+  //    m_JpxInlineData.width = image_info.width;
+  //    m_JpxInlineData.height = image_info.height;
+  //    m_JpxInlineData.data.reserve(image_info.width * image_info.height);
+  //    for (uint32_t row = 0; row < image_info.height; ++row) {
+  //      const uint8_t* src = result_bitmap->GetScanline(row).data();
+  //      uint8_t* dest = rgb_bitmap->GetWritableScanline(row).data();
+  //      for (uint32_t col = 0; col < image_info.width; ++col) {
+  //        uint8_t a = src[3];
+  //        m_JpxInlineData.data.push_back(a);
+  //        uint8_t na = 255 - a;
+  //        uint8_t b = (src[0] * a + 255 * na) / 255;
+  //        uint8_t g = (src[1] * a + 255 * na) / 255;
+  //        uint8_t r = (src[2] * a + 255 * na) / 255;
+  //        dest[0] = b;
+  //        dest[1] = g;
+  //        dest[2] = r;
+  //        src += 4;
+  //        dest += 3;
+  //      }
+  //    }
+  //  } else {
+  //    // TODO(thestig): Is there existing code that does this already?
+  //    for (uint32_t row = 0; row < image_info.height; ++row) {
+  //      const uint8_t* src = result_bitmap->GetScanline(row).data();
+  //      uint8_t* dest = rgb_bitmap->GetWritableScanline(row).data();
+  //      for (uint32_t col = 0; col < image_info.width; ++col) {
+  //        memcpy(dest, src, 3);
+  //        src += 4;
+  //        dest += 3;
+  //      }
+  //    }
+  //  }
+  //  result_bitmap = std::move(rgb_bitmap);
+  //} else if (m_pColorSpace &&
+  //           m_pColorSpace->GetFamily() == CPDF_ColorSpace::Family::kIndexed &&
+  //           m_bpc < 8) {
+  //  int scale = 8 - m_bpc;
+  //  for (uint32_t row = 0; row < image_info.height; ++row) {
+  //    uint8_t* scanline = result_bitmap->GetWritableScanline(row).data();
+  //    for (uint32_t col = 0; col < image_info.width; ++col) {
+  //      *scanline = (*scanline) >> scale;
+  //      ++scanline;
+  //    }
+  //  }
+  //}
+  //m_bpc = 8;
+  //return result_bitmap;
 }
 
 CPDF_DIB::LoadState CPDF_DIB::StartLoadMask() {
diff --git a/core/fpdfapi/page/cpdf_dib.h b/core/fpdfapi/page/cpdf_dib.h
index e3f28c0fd9..147393bc33 100644
--- a/core/fpdfapi/page/cpdf_dib.h
+++ b/core/fpdfapi/page/cpdf_dib.h
@@ -30,7 +30,7 @@ struct DIB_COMP_DATA {
 };
 
 namespace fxcodec {
-class Jbig2Context;
+//class Jbig2Context;
 class ScanlineDecoder;
 }  // namespace fxcodec
 
@@ -133,7 +133,7 @@ class CPDF_DIB final : public CFX_DIBBase {
   JpxSMaskInlineData m_JpxInlineData;
 
   // Must come after |m_pCachedBitmap|.
-  std::unique_ptr<fxcodec::Jbig2Context> m_pJbig2Context;
+  //std::unique_ptr<fxcodec::Jbig2Context> m_pJbig2Context;
 };
 
 #endif  // CORE_FPDFAPI_PAGE_CPDF_DIB_H_
diff --git a/core/fpdfapi/page/cpdf_function.h b/core/fpdfapi/page/cpdf_function.h
index a0f3382b03..bbdf473fe9 100644
--- a/core/fpdfapi/page/cpdf_function.h
+++ b/core/fpdfapi/page/cpdf_function.h
@@ -11,7 +11,7 @@
 #include <set>
 #include <vector>
 
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/span.h"
 
 class CPDF_ExpIntFunc;
diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp
index c2db8e1939..9334db0d58 100644
--- a/core/fpdfapi/page/cpdf_image.cpp
+++ b/core/fpdfapi/page/cpdf_image.cpp
@@ -23,7 +23,7 @@
 #include "core/fpdfapi/parser/cpdf_reference.h"
 #include "core/fpdfapi/parser/cpdf_stream.h"
 #include "core/fpdfapi/parser/cpdf_string.h"
-#include "core/fxcodec/jpeg/jpegmodule.h"
+//#include "core/fxcodec/jpeg/jpegmodule.h"
 #include "core/fxcrt/fx_memory_wrappers.h"
 #include "core/fxcrt/fx_stream.h"
 #include "core/fxcrt/span_util.h"
@@ -83,46 +83,47 @@ CPDF_Dictionary* CPDF_Image::GetDict() const {
 
 RetainPtr<CPDF_Dictionary> CPDF_Image::InitJPEG(
     pdfium::span<uint8_t> src_span) {
-  absl::optional<JpegModule::ImageInfo> info_opt =
-      JpegModule::LoadInfo(src_span);
-  if (!info_opt.has_value())
-    return nullptr;
-
-  const JpegModule::ImageInfo& info = info_opt.value();
-  if (!IsValidJpegComponent(info.num_components) ||
-      !IsValidJpegBitsPerComponent(info.bits_per_components)) {
-    return nullptr;
-  }
-
-  RetainPtr<CPDF_Dictionary> pDict =
-      CreateXObjectImageDict(info.width, info.height);
-  const char* csname = nullptr;
-  if (info.num_components == 1) {
-    csname = "DeviceGray";
-  } else if (info.num_components == 3) {
-    csname = "DeviceRGB";
-  } else if (info.num_components == 4) {
-    csname = "DeviceCMYK";
-    CPDF_Array* pDecode = pDict->SetNewFor<CPDF_Array>("Decode");
-    for (int n = 0; n < 4; n++) {
-      pDecode->AppendNew<CPDF_Number>(1);
-      pDecode->AppendNew<CPDF_Number>(0);
-    }
-  }
-  pDict->SetNewFor<CPDF_Name>("ColorSpace", csname);
-  pDict->SetNewFor<CPDF_Number>("BitsPerComponent", info.bits_per_components);
-  pDict->SetNewFor<CPDF_Name>("Filter", "DCTDecode");
-  if (!info.color_transform) {
-    CPDF_Dictionary* pParms =
-        pDict->SetNewFor<CPDF_Dictionary>(pdfium::stream::kDecodeParms);
-    pParms->SetNewFor<CPDF_Number>("ColorTransform", 0);
-  }
-  m_bIsMask = false;
-  m_Width = info.width;
-  m_Height = info.height;
-  if (!m_pStream)
-    m_pStream = pdfium::MakeRetain<CPDF_Stream>();
-  return pDict;
+  return nullptr;
+  //absl::optional<JpegModule::ImageInfo> info_opt =
+  //    JpegModule::LoadInfo(src_span);
+  //if (!info_opt.has_value())
+  //  return nullptr;
+
+  //const JpegModule::ImageInfo& info = info_opt.value();
+  //if (!IsValidJpegComponent(info.num_components) ||
+  //    !IsValidJpegBitsPerComponent(info.bits_per_components)) {
+  //  return nullptr;
+  //}
+
+  //RetainPtr<CPDF_Dictionary> pDict =
+  //    CreateXObjectImageDict(info.width, info.height);
+  //const char* csname = nullptr;
+  //if (info.num_components == 1) {
+  //  csname = "DeviceGray";
+  //} else if (info.num_components == 3) {
+  //  csname = "DeviceRGB";
+  //} else if (info.num_components == 4) {
+  //  csname = "DeviceCMYK";
+  //  CPDF_Array* pDecode = pDict->SetNewFor<CPDF_Array>("Decode");
+  //  for (int n = 0; n < 4; n++) {
+  //    pDecode->AppendNew<CPDF_Number>(1);
+  //    pDecode->AppendNew<CPDF_Number>(0);
+  //  }
+  //}
+  //pDict->SetNewFor<CPDF_Name>("ColorSpace", csname);
+  //pDict->SetNewFor<CPDF_Number>("BitsPerComponent", info.bits_per_components);
+  //pDict->SetNewFor<CPDF_Name>("Filter", "DCTDecode");
+  //if (!info.color_transform) {
+  //  CPDF_Dictionary* pParms =
+  //      pDict->SetNewFor<CPDF_Dictionary>(pdfium::stream::kDecodeParms);
+  //  pParms->SetNewFor<CPDF_Number>("ColorTransform", 0);
+  //}
+  //m_bIsMask = false;
+  //m_Width = info.width;
+  //m_Height = info.height;
+  //if (!m_pStream)
+  //  m_pStream = pdfium::MakeRetain<CPDF_Stream>();
+  //return pDict;
 }
 
 void CPDF_Image::SetJpegImage(const RetainPtr<IFX_SeekableReadStream>& pFile) {
diff --git a/core/fpdfapi/page/cpdf_page.h b/core/fpdfapi/page/cpdf_page.h
index d2ff1ac334..cfd9a61809 100644
--- a/core/fpdfapi/page/cpdf_page.h
+++ b/core/fpdfapi/page/cpdf_page.h
@@ -17,7 +17,7 @@
 #include "core/fxcrt/observed_ptr.h"
 #include "core/fxcrt/retain_ptr.h"
 #include "core/fxcrt/unowned_ptr.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CPDF_Dictionary;
 class CPDF_Document;
diff --git a/core/fpdfapi/page/cpdf_pageobjectholder.h b/core/fpdfapi/page/cpdf_pageobjectholder.h
index c4b0fc4e9c..691240d7ba 100644
--- a/core/fpdfapi/page/cpdf_pageobjectholder.h
+++ b/core/fpdfapi/page/cpdf_pageobjectholder.h
@@ -23,7 +23,7 @@
 #include "core/fxcrt/retain_ptr.h"
 #include "core/fxcrt/unowned_ptr.h"
 #include "core/fxge/dib/fx_dib.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CPDF_ContentParser;
 class CPDF_Document;
diff --git a/core/fpdfapi/page/cpdf_streamparser.cpp b/core/fpdfapi/page/cpdf_streamparser.cpp
index 333108b256..30a61a0ea5 100644
--- a/core/fpdfapi/page/cpdf_streamparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamparser.cpp
@@ -24,7 +24,7 @@
 #include "core/fpdfapi/parser/cpdf_string.h"
 #include "core/fpdfapi/parser/fpdf_parser_decode.h"
 #include "core/fpdfapi/parser/fpdf_parser_utility.h"
-#include "core/fxcodec/jpeg/jpegmodule.h"
+//#include "core/fxcodec/jpeg/jpegmodule.h"
 #include "core/fxcodec/scanlinedecoder.h"
 #include "core/fxcrt/fx_extension.h"
 #include "core/fxcrt/fx_memory_wrappers.h"
@@ -96,10 +96,10 @@ uint32_t DecodeInlineStream(pdfium::span<const uint8_t> src_span,
                             &ignored_size);
   }
   if (decoder == "DCTDecode") {
-    std::unique_ptr<ScanlineDecoder> pDecoder = JpegModule::CreateDecoder(
-        src_span, width, height, 0,
-        !pParam || pParam->GetIntegerFor("ColorTransform", 1));
-    return DecodeAllScanlines(std::move(pDecoder));
+    //std::unique_ptr<ScanlineDecoder> pDecoder = JpegModule::CreateDecoder(
+    //    src_span, width, height, 0,
+    //    !pParam || pParam->GetIntegerFor("ColorTransform", 1));
+    return DecodeAllScanlines(nullptr /* std::move(pDecoder)*/);
   }
   if (decoder == "CCITTFaxDecode") {
     std::unique_ptr<ScanlineDecoder> pDecoder =
diff --git a/core/fpdfapi/page/ipdf_page.h b/core/fpdfapi/page/ipdf_page.h
index 742a1f1d42..ba1423b365 100644
--- a/core/fpdfapi/page/ipdf_page.h
+++ b/core/fpdfapi/page/ipdf_page.h
@@ -9,7 +9,7 @@
 
 #include "core/fxcrt/fx_coordinates.h"
 #include "core/fxcrt/retain_ptr.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CPDF_Document;
 class CPDF_Page;
diff --git a/core/fpdfapi/parser/cpdf_array.h b/core/fpdfapi/parser/cpdf_array.h
index 2270c7d9c8..12ce69f278 100644
--- a/core/fpdfapi/parser/cpdf_array.h
+++ b/core/fpdfapi/parser/cpdf_array.h
@@ -18,7 +18,7 @@
 #include "core/fpdfapi/parser/cpdf_object.h"
 #include "core/fxcrt/fx_coordinates.h"
 #include "core/fxcrt/retain_ptr.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/check.h"
 
 // Arrays never contain nullptrs for objects within bounds, but some of the
diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp
index 4e714821ce..31c6f6521a 100644
--- a/core/fpdfapi/parser/cpdf_document.cpp
+++ b/core/fpdfapi/parser/cpdf_document.cpp
@@ -16,7 +16,7 @@
 #include "core/fpdfapi/parser/cpdf_reference.h"
 #include "core/fpdfapi/parser/cpdf_stream.h"
 #include "core/fpdfapi/parser/fpdf_parser_utility.h"
-#include "core/fxcodec/jbig2/JBig2_DocumentContext.h"
+//#include "core/fxcodec/jbig2/JBig2_DocumentContext.h"
 #include "core/fxcrt/fx_codepage.h"
 #include "core/fxcrt/scoped_set_insertion.h"
 #include "core/fxcrt/stl_util.h"
@@ -307,11 +307,11 @@ void CPDF_Document::SetPageObjNum(int iPage, uint32_t objNum) {
   m_PageList[iPage] = objNum;
 }
 
-JBig2_DocumentContext* CPDF_Document::GetOrCreateCodecContext() {
-  if (!m_pCodecContext)
-    m_pCodecContext = std::make_unique<JBig2_DocumentContext>();
-  return m_pCodecContext.get();
-}
+//JBig2_DocumentContext* CPDF_Document::GetOrCreateCodecContext() {
+//  if (!m_pCodecContext)
+//    m_pCodecContext = std::make_unique<JBig2_DocumentContext>();
+//  return m_pCodecContext.get();
+//}
 
 CPDF_Stream* CPDF_Document::CreateModifiedAPStream() {
   auto* stream = NewIndirect<CPDF_Stream>();
diff --git a/core/fpdfapi/parser/cpdf_document.h b/core/fpdfapi/parser/cpdf_document.h
index d5b59aad39..f8aa047d98 100644
--- a/core/fpdfapi/parser/cpdf_document.h
+++ b/core/fpdfapi/parser/cpdf_document.h
@@ -21,7 +21,7 @@
 class CPDF_ReadValidator;
 class CPDF_StreamAcc;
 class IFX_SeekableReadStream;
-class JBig2_DocumentContext;
+//class JBig2_DocumentContext;
 
 class CPDF_Document : public Observable,
                       public CPDF_Parser::ParsedObjectsHolder {
@@ -106,7 +106,7 @@ class CPDF_Document : public Observable,
 
   void SetPageObjNum(int iPage, uint32_t objNum);
 
-  JBig2_DocumentContext* GetOrCreateCodecContext();
+  //JBig2_DocumentContext* GetOrCreateCodecContext();
   LinkListIface* GetLinksContext() const { return m_pLinksContext.get(); }
   void SetLinksContext(std::unique_ptr<LinkListIface> pContext) {
     m_pLinksContext = std::move(pContext);
@@ -195,7 +195,7 @@ class CPDF_Document : public Observable,
 
   std::unique_ptr<RenderDataIface> m_pDocRender;
   std::unique_ptr<PageDataIface> m_pDocPage;  // Must be after |m_pDocRender|.
-  std::unique_ptr<JBig2_DocumentContext> m_pCodecContext;
+  //std::unique_ptr<JBig2_DocumentContext> m_pCodecContext;
   std::unique_ptr<LinkListIface> m_pLinksContext;
   std::set<uint32_t> m_ModifiedAPStreamIDs;
   std::vector<uint32_t> m_PageList;  // Page number to page's dict objnum.
diff --git a/core/fpdfapi/parser/fpdf_parser_decode.h b/core/fpdfapi/parser/fpdf_parser_decode.h
index 537456bee6..cabbee5037 100644
--- a/core/fpdfapi/parser/fpdf_parser_decode.h
+++ b/core/fpdfapi/parser/fpdf_parser_decode.h
@@ -14,7 +14,7 @@
 #include "core/fxcrt/fx_memory_wrappers.h"
 #include "core/fxcrt/fx_string.h"
 #include "core/fxcrt/retain_ptr.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/span.h"
 
 class CPDF_Array;
diff --git a/core/fpdfapi/parser/fpdf_parser_utility.h b/core/fpdfapi/parser/fpdf_parser_utility.h
index fbe87bd4b2..5d3ca3144f 100644
--- a/core/fpdfapi/parser/fpdf_parser_utility.h
+++ b/core/fpdfapi/parser/fpdf_parser_utility.h
@@ -12,7 +12,7 @@
 
 #include "core/fxcrt/bytestring.h"
 #include "core/fxcrt/retain_ptr.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CPDF_Array;
 class CPDF_Dictionary;
diff --git a/core/fpdfapi/render/cpdf_imagerenderer.cpp b/core/fpdfapi/render/cpdf_imagerenderer.cpp
index b0a4b6ed61..6a6c60970f 100644
--- a/core/fpdfapi/render/cpdf_imagerenderer.cpp
+++ b/core/fpdfapi/render/cpdf_imagerenderer.cpp
@@ -30,7 +30,7 @@
 #include "core/fpdfapi/render/cpdf_renderstatus.h"
 #include "core/fxcrt/fx_safe_types.h"
 #include "core/fxcrt/maybe_owned.h"
-#include "core/fxge/cfx_defaultrenderdevice.h"
+//#include "core/fxge/cfx_defaultrenderdevice.h"
 #include "core/fxge/cfx_fillrenderoptions.h"
 #include "core/fxge/cfx_path.h"
 #include "core/fxge/dib/cfx_dibbase.h"
@@ -74,91 +74,91 @@ bool CPDF_ImageRenderer::StartLoadDIBBase() {
 }
 
 bool CPDF_ImageRenderer::StartRenderDIBBase() {
-  if (!m_Loader.GetBitmap())
+  //if (!m_Loader.GetBitmap())
     return false;
 
-  CPDF_GeneralState& state = m_pImageObject->m_GeneralState;
-  m_BitmapAlpha = FXSYS_roundf(255 * state.GetFillAlpha());
-  m_pDIBBase = m_Loader.GetBitmap();
-  if (GetRenderOptions().ColorModeIs(CPDF_RenderOptions::kAlpha) &&
-      !m_Loader.GetMask()) {
-    return StartBitmapAlpha();
-  }
-  if (state.GetTR()) {
-    if (!state.GetTransferFunc())
-      state.SetTransferFunc(m_pRenderStatus->GetTransferFunc(state.GetTR()));
-
-    if (state.GetTransferFunc() && !state.GetTransferFunc()->GetIdentity())
-      m_pDIBBase = m_Loader.TranslateImage(state.GetTransferFunc());
-  }
-  m_FillArgb = 0;
-  m_bPatternColor = false;
-  m_pPattern = nullptr;
-  if (m_pDIBBase->IsMaskFormat()) {
-    const CPDF_Color* pColor = m_pImageObject->m_ColorState.GetFillColor();
-    if (pColor && pColor->IsPattern()) {
-      m_pPattern.Reset(pColor->GetPattern());
-      if (m_pPattern)
-        m_bPatternColor = true;
-    }
-    m_FillArgb = m_pRenderStatus->GetFillArgb(m_pImageObject.Get());
-  } else if (GetRenderOptions().ColorModeIs(CPDF_RenderOptions::kGray)) {
-    RetainPtr<CFX_DIBitmap> pClone = m_pDIBBase->Realize();
-    if (!pClone)
-      return false;
-
-    pClone->ConvertColorScale(0xffffff, 0);
-    m_pDIBBase = pClone;
-  }
-  m_ResampleOptions = FXDIB_ResampleOptions();
-  if (GetRenderOptions().GetOptions().bForceHalftone)
-    m_ResampleOptions.bHalftone = true;
-
-  if (m_pRenderStatus->GetRenderDevice()->GetDeviceType() !=
-      DeviceType::kDisplay) {
-    HandleFilters();
-  }
-
-  if (GetRenderOptions().GetOptions().bNoImageSmooth)
-    m_ResampleOptions.bNoSmoothing = true;
-  else if (m_pImageObject->GetImage()->IsInterpol())
-    m_ResampleOptions.bInterpolateBilinear = true;
-
-  if (m_Loader.GetMask())
-    return DrawMaskedImage();
-
-  if (m_bPatternColor)
-    return DrawPatternImage();
-
-  if (m_BitmapAlpha != 255 || !state.HasRef() || !state.GetFillOP() ||
-      state.GetOPMode() != 0 || state.GetBlendType() != BlendMode::kNormal ||
-      state.GetStrokeAlpha() != 1.0f || state.GetFillAlpha() != 1.0f) {
-    return StartDIBBase();
-  }
-  CPDF_Document* pDocument = nullptr;
-  CPDF_Page* pPage = nullptr;
-  if (auto* pPageCache = m_pRenderStatus->GetContext()->GetPageCache()) {
-    pPage = pPageCache->GetPage();
-    pDocument = pPage->GetDocument();
-  } else {
-    pDocument = m_pImageObject->GetImage()->GetDocument();
-  }
-  CPDF_Dictionary* pPageResources = pPage ? pPage->GetPageResources() : nullptr;
-  CPDF_Object* pCSObj =
-      m_pImageObject->GetImage()->GetStream()->GetDict()->GetDirectObjectFor(
-          "ColorSpace");
-  auto* pData = CPDF_DocPageData::FromDocument(pDocument);
-  RetainPtr<CPDF_ColorSpace> pColorSpace =
-      pData->GetColorSpace(pCSObj, pPageResources);
-  if (pColorSpace) {
-    CPDF_ColorSpace::Family format = pColorSpace->GetFamily();
-    if (format == CPDF_ColorSpace::Family::kDeviceCMYK ||
-        format == CPDF_ColorSpace::Family::kSeparation ||
-        format == CPDF_ColorSpace::Family::kDeviceN) {
-      m_BlendType = BlendMode::kDarken;
-    }
-  }
-  return StartDIBBase();
+  //CPDF_GeneralState& state = m_pImageObject->m_GeneralState;
+  //m_BitmapAlpha = FXSYS_roundf(255 * state.GetFillAlpha());
+  //m_pDIBBase = m_Loader.GetBitmap();
+  //if (GetRenderOptions().ColorModeIs(CPDF_RenderOptions::kAlpha) &&
+  //    !m_Loader.GetMask()) {
+  //  return StartBitmapAlpha();
+  //}
+  //if (state.GetTR()) {
+  //  if (!state.GetTransferFunc())
+  //    state.SetTransferFunc(m_pRenderStatus->GetTransferFunc(state.GetTR()));
+
+  //  if (state.GetTransferFunc() && !state.GetTransferFunc()->GetIdentity())
+  //    m_pDIBBase = m_Loader.TranslateImage(state.GetTransferFunc());
+  //}
+  //m_FillArgb = 0;
+  //m_bPatternColor = false;
+  //m_pPattern = nullptr;
+  //if (m_pDIBBase->IsMaskFormat()) {
+  //  const CPDF_Color* pColor = m_pImageObject->m_ColorState.GetFillColor();
+  //  if (pColor && pColor->IsPattern()) {
+  //    m_pPattern.Reset(pColor->GetPattern());
+  //    if (m_pPattern)
+  //      m_bPatternColor = true;
+  //  }
+  //  m_FillArgb = m_pRenderStatus->GetFillArgb(m_pImageObject.Get());
+  //} else if (GetRenderOptions().ColorModeIs(CPDF_RenderOptions::kGray)) {
+  //  RetainPtr<CFX_DIBitmap> pClone = m_pDIBBase->Realize();
+  //  if (!pClone)
+  //    return false;
+
+  //  pClone->ConvertColorScale(0xffffff, 0);
+  //  m_pDIBBase = pClone;
+  //}
+  //m_ResampleOptions = FXDIB_ResampleOptions();
+  //if (GetRenderOptions().GetOptions().bForceHalftone)
+  //  m_ResampleOptions.bHalftone = true;
+
+  //if (m_pRenderStatus->GetRenderDevice()->GetDeviceType() !=
+  //    DeviceType::kDisplay) {
+  //  HandleFilters();
+  //}
+
+  //if (GetRenderOptions().GetOptions().bNoImageSmooth)
+  //  m_ResampleOptions.bNoSmoothing = true;
+  //else if (m_pImageObject->GetImage()->IsInterpol())
+  //  m_ResampleOptions.bInterpolateBilinear = true;
+
+  //if (m_Loader.GetMask())
+  //  return DrawMaskedImage();
+
+  //if (m_bPatternColor)
+  //  return DrawPatternImage();
+
+  //if (m_BitmapAlpha != 255 || !state.HasRef() || !state.GetFillOP() ||
+  //    state.GetOPMode() != 0 || state.GetBlendType() != BlendMode::kNormal ||
+  //    state.GetStrokeAlpha() != 1.0f || state.GetFillAlpha() != 1.0f) {
+  //  return StartDIBBase();
+  //}
+  //CPDF_Document* pDocument = nullptr;
+  //CPDF_Page* pPage = nullptr;
+  //if (auto* pPageCache = m_pRenderStatus->GetContext()->GetPageCache()) {
+  //  pPage = pPageCache->GetPage();
+  //  pDocument = pPage->GetDocument();
+  //} else {
+  //  pDocument = m_pImageObject->GetImage()->GetDocument();
+  //}
+  //CPDF_Dictionary* pPageResources = pPage ? pPage->GetPageResources() : nullptr;
+  //CPDF_Object* pCSObj =
+  //    m_pImageObject->GetImage()->GetStream()->GetDict()->GetDirectObjectFor(
+  //        "ColorSpace");
+  //auto* pData = CPDF_DocPageData::FromDocument(pDocument);
+  //RetainPtr<CPDF_ColorSpace> pColorSpace =
+  //    pData->GetColorSpace(pCSObj, pPageResources);
+  //if (pColorSpace) {
+  //  CPDF_ColorSpace::Family format = pColorSpace->GetFamily();
+  //  if (format == CPDF_ColorSpace::Family::kDeviceCMYK ||
+  //      format == CPDF_ColorSpace::Family::kSeparation ||
+  //      format == CPDF_ColorSpace::Family::kDeviceN) {
+  //    m_BlendType = BlendMode::kDarken;
+  //  }
+  //}
+  //return StartDIBBase();
 }
 
 bool CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus,
@@ -201,14 +201,15 @@ bool CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus,
 }
 
 bool CPDF_ImageRenderer::NotDrawing() const {
-  return m_pRenderStatus->IsPrint() &&
-         !(m_pRenderStatus->GetRenderDevice()->GetRenderCaps() &
-           FXRC_BLEND_MODE);
+  return true;
+  //return m_pRenderStatus->IsPrint() &&
+  //       !(m_pRenderStatus->GetRenderDevice()->GetRenderCaps() &
+  //         FXRC_BLEND_MODE);
 }
 
 FX_RECT CPDF_ImageRenderer::GetDrawRect() const {
   FX_RECT rect = m_ImageMatrix.GetUnitRect().GetOuterRect();
-  rect.Intersect(m_pRenderStatus->GetRenderDevice()->GetClipBox());
+  //rect.Intersect(m_pRenderStatus->GetRenderDevice()->GetClipBox());
   return rect;
 }
 
@@ -224,42 +225,42 @@ void CPDF_ImageRenderer::CalculateDrawImage(
     const RetainPtr<CFX_DIBBase>& pDIBBase,
     const CFX_Matrix& mtNewMatrix,
     const FX_RECT& rect) const {
-  CPDF_RenderStatus bitmap_render(m_pRenderStatus->GetContext(),
-                                  pBitmapDevice2);
-  bitmap_render.SetDropObjects(m_pRenderStatus->GetDropObjects());
-  bitmap_render.SetStdCS(true);
-  bitmap_render.Initialize(nullptr, nullptr);
-
-  CPDF_ImageRenderer image_render;
-  if (image_render.Start(&bitmap_render, pDIBBase, 0xffffffff, mtNewMatrix,
-                         m_ResampleOptions, true)) {
-    image_render.Continue(nullptr);
-  }
-  if (m_Loader.MatteColor() == 0xffffffff)
-    return;
-  int matte_r = FXARGB_R(m_Loader.MatteColor());
-  int matte_g = FXARGB_G(m_Loader.MatteColor());
-  int matte_b = FXARGB_B(m_Loader.MatteColor());
-  for (int row = 0; row < rect.Height(); row++) {
-    uint8_t* dest_scan =
-        pBitmapDevice1->GetBitmap()->GetWritableScanline(row).data();
-    const uint8_t* mask_scan =
-        pBitmapDevice2->GetBitmap()->GetScanline(row).data();
-    for (int col = 0; col < rect.Width(); col++) {
-      int alpha = *mask_scan++;
-      if (!alpha) {
-        dest_scan += 4;
-        continue;
-      }
-      int orig = (*dest_scan - matte_b) * 255 / alpha + matte_b;
-      *dest_scan++ = pdfium::clamp(orig, 0, 255);
-      orig = (*dest_scan - matte_g) * 255 / alpha + matte_g;
-      *dest_scan++ = pdfium::clamp(orig, 0, 255);
-      orig = (*dest_scan - matte_r) * 255 / alpha + matte_r;
-      *dest_scan++ = pdfium::clamp(orig, 0, 255);
-      dest_scan++;
-    }
-  }
+  //CPDF_RenderStatus bitmap_render(m_pRenderStatus->GetContext(),
+  //                                pBitmapDevice2);
+  //bitmap_render.SetDropObjects(m_pRenderStatus->GetDropObjects());
+  //bitmap_render.SetStdCS(true);
+  //bitmap_render.Initialize(nullptr, nullptr);
+
+  //CPDF_ImageRenderer image_render;
+  //if (image_render.Start(&bitmap_render, pDIBBase, 0xffffffff, mtNewMatrix,
+  //                       m_ResampleOptions, true)) {
+  //  image_render.Continue(nullptr);
+  //}
+  //if (m_Loader.MatteColor() == 0xffffffff)
+  //  return;
+  //int matte_r = FXARGB_R(m_Loader.MatteColor());
+  //int matte_g = FXARGB_G(m_Loader.MatteColor());
+  //int matte_b = FXARGB_B(m_Loader.MatteColor());
+  //for (int row = 0; row < rect.Height(); row++) {
+  //  uint8_t* dest_scan =
+  //      pBitmapDevice1->GetBitmap()->GetWritableScanline(row).data();
+  //  const uint8_t* mask_scan =
+  //      pBitmapDevice2->GetBitmap()->GetScanline(row).data();
+  //  for (int col = 0; col < rect.Width(); col++) {
+  //    int alpha = *mask_scan++;
+  //    if (!alpha) {
+  //      dest_scan += 4;
+  //      continue;
+  //    }
+  //    int orig = (*dest_scan - matte_b) * 255 / alpha + matte_b;
+  //    *dest_scan++ = pdfium::clamp(orig, 0, 255);
+  //    orig = (*dest_scan - matte_g) * 255 / alpha + matte_g;
+  //    *dest_scan++ = pdfium::clamp(orig, 0, 255);
+  //    orig = (*dest_scan - matte_r) * 255 / alpha + matte_r;
+  //    *dest_scan++ = pdfium::clamp(orig, 0, 255);
+  //    dest_scan++;
+  //  }
+  //}
 }
 
 const CPDF_RenderOptions& CPDF_ImageRenderer::GetRenderOptions() const {
@@ -267,272 +268,272 @@ const CPDF_RenderOptions& CPDF_ImageRenderer::GetRenderOptions() const {
 }
 
 bool CPDF_ImageRenderer::DrawPatternImage() {
-  if (NotDrawing()) {
-    m_Result = false;
-    return false;
-  }
-
-  FX_RECT rect = GetDrawRect();
-  if (rect.IsEmpty())
+  //if (NotDrawing()) {
+  //  m_Result = false;
     return false;
-
-  CFX_Matrix new_matrix = GetDrawMatrix(rect);
-  CFX_DefaultRenderDevice bitmap_device1;
-  if (!bitmap_device1.Create(rect.Width(), rect.Height(), FXDIB_Format::kRgb32,
-                             nullptr)) {
-    return true;
-  }
-  bitmap_device1.GetBitmap()->Clear(0xffffff);
-
-  CPDF_RenderStatus bitmap_render(m_pRenderStatus->GetContext(),
-                                  &bitmap_device1);
-  bitmap_render.SetOptions(GetRenderOptions());
-  bitmap_render.SetDropObjects(m_pRenderStatus->GetDropObjects());
-  bitmap_render.SetStdCS(true);
-  bitmap_render.Initialize(nullptr, nullptr);
-
-  CFX_Matrix patternDevice = m_mtObj2Device;
-  patternDevice.Translate(static_cast<float>(-rect.left),
-                          static_cast<float>(-rect.top));
-  if (CPDF_TilingPattern* pTilingPattern = m_pPattern->AsTilingPattern()) {
-    bitmap_render.DrawTilingPattern(pTilingPattern, m_pImageObject.Get(),
-                                    patternDevice, false);
-  } else if (CPDF_ShadingPattern* pShadingPattern =
-                 m_pPattern->AsShadingPattern()) {
-    bitmap_render.DrawShadingPattern(pShadingPattern, m_pImageObject.Get(),
-                                     patternDevice, false);
-  }
-
-  CFX_DefaultRenderDevice bitmap_device2;
-  if (!bitmap_device2.Create(rect.Width(), rect.Height(),
-                             FXDIB_Format::k8bppRgb, nullptr)) {
-    return true;
-  }
-  bitmap_device2.GetBitmap()->Clear(0);
-  CalculateDrawImage(&bitmap_device1, &bitmap_device2, m_pDIBBase, new_matrix,
-                     rect);
-  bitmap_device2.GetBitmap()->ConvertFormat(FXDIB_Format::k8bppMask);
-  bitmap_device1.GetBitmap()->MultiplyAlpha(bitmap_device2.GetBitmap());
-  bitmap_device1.GetBitmap()->MultiplyAlpha(255);
-  m_pRenderStatus->GetRenderDevice()->SetDIBitsWithBlend(
-      bitmap_device1.GetBitmap(), rect.left, rect.top, m_BlendType);
-  return false;
+  //}
+
+  //FX_RECT rect = GetDrawRect();
+  //if (rect.IsEmpty())
+  //  return false;
+
+  //CFX_Matrix new_matrix = GetDrawMatrix(rect);
+  //CFX_DefaultRenderDevice bitmap_device1;
+  //if (!bitmap_device1.Create(rect.Width(), rect.Height(), FXDIB_Format::kRgb32,
+  //                           nullptr)) {
+  //  return true;
+  //}
+  //bitmap_device1.GetBitmap()->Clear(0xffffff);
+
+  //CPDF_RenderStatus bitmap_render(m_pRenderStatus->GetContext(),
+  //                                &bitmap_device1);
+  //bitmap_render.SetOptions(GetRenderOptions());
+  //bitmap_render.SetDropObjects(m_pRenderStatus->GetDropObjects());
+  //bitmap_render.SetStdCS(true);
+  //bitmap_render.Initialize(nullptr, nullptr);
+
+  //CFX_Matrix patternDevice = m_mtObj2Device;
+  //patternDevice.Translate(static_cast<float>(-rect.left),
+  //                        static_cast<float>(-rect.top));
+  //if (CPDF_TilingPattern* pTilingPattern = m_pPattern->AsTilingPattern()) {
+  //  bitmap_render.DrawTilingPattern(pTilingPattern, m_pImageObject.Get(),
+  //                                  patternDevice, false);
+  //} else if (CPDF_ShadingPattern* pShadingPattern =
+  //               m_pPattern->AsShadingPattern()) {
+  //  bitmap_render.DrawShadingPattern(pShadingPattern, m_pImageObject.Get(),
+  //                                   patternDevice, false);
+  //}
+
+  //CFX_DefaultRenderDevice bitmap_device2;
+  //if (!bitmap_device2.Create(rect.Width(), rect.Height(),
+  //                           FXDIB_Format::k8bppRgb, nullptr)) {
+  //  return true;
+  //}
+  //bitmap_device2.GetBitmap()->Clear(0);
+  //CalculateDrawImage(&bitmap_device1, &bitmap_device2, m_pDIBBase, new_matrix,
+  //                   rect);
+  //bitmap_device2.GetBitmap()->ConvertFormat(FXDIB_Format::k8bppMask);
+  //bitmap_device1.GetBitmap()->MultiplyAlpha(bitmap_device2.GetBitmap());
+  //bitmap_device1.GetBitmap()->MultiplyAlpha(255);
+  //m_pRenderStatus->GetRenderDevice()->SetDIBitsWithBlend(
+  //    bitmap_device1.GetBitmap(), rect.left, rect.top, m_BlendType);
+  //return false;
 }
 
 bool CPDF_ImageRenderer::DrawMaskedImage() {
-  if (NotDrawing()) {
-    m_Result = false;
-    return false;
-  }
-
-  FX_RECT rect = GetDrawRect();
-  if (rect.IsEmpty())
-    return false;
-
-  CFX_Matrix new_matrix = GetDrawMatrix(rect);
-  CFX_DefaultRenderDevice bitmap_device1;
-  if (!bitmap_device1.Create(rect.Width(), rect.Height(), FXDIB_Format::kRgb32,
-                             nullptr)) {
-    return true;
-  }
-#if defined(_SKIA_SUPPORT_)
-  bitmap_device1.Clear(0xffffff);
-#else
-  bitmap_device1.GetBitmap()->Clear(0xffffff);
-#endif
-  CPDF_RenderStatus bitmap_render(m_pRenderStatus->GetContext(),
-                                  &bitmap_device1);
-  bitmap_render.SetDropObjects(m_pRenderStatus->GetDropObjects());
-  bitmap_render.SetStdCS(true);
-  bitmap_render.Initialize(nullptr, nullptr);
-  CPDF_ImageRenderer image_render;
-  if (image_render.Start(&bitmap_render, m_pDIBBase, 0, new_matrix,
-                         m_ResampleOptions, true)) {
-    image_render.Continue(nullptr);
-  }
-  CFX_DefaultRenderDevice bitmap_device2;
-  if (!bitmap_device2.Create(rect.Width(), rect.Height(),
-                             FXDIB_Format::k8bppRgb, nullptr)) {
-    return true;
-  }
-#if defined(_SKIA_SUPPORT_)
-  bitmap_device2.Clear(0);
-#else
-  bitmap_device2.GetBitmap()->Clear(0);
-#endif
-  CalculateDrawImage(&bitmap_device1, &bitmap_device2, m_Loader.GetMask(),
-                     new_matrix, rect);
-#if defined(_SKIA_SUPPORT_)
-  m_pRenderStatus->GetRenderDevice()->SetBitsWithMask(
-      bitmap_device1.GetBitmap(), bitmap_device2.GetBitmap(), rect.left,
-      rect.top, m_BitmapAlpha, m_BlendType);
-#else
-  bitmap_device2.GetBitmap()->ConvertFormat(FXDIB_Format::k8bppMask);
-  bitmap_device1.GetBitmap()->MultiplyAlpha(bitmap_device2.GetBitmap());
-  if (m_BitmapAlpha < 255)
-    bitmap_device1.GetBitmap()->MultiplyAlpha(m_BitmapAlpha);
-  m_pRenderStatus->GetRenderDevice()->SetDIBitsWithBlend(
-      bitmap_device1.GetBitmap(), rect.left, rect.top, m_BlendType);
-#endif  //  defined(_SKIA_SUPPORT_)
+//  if (NotDrawing()) {
+//    m_Result = false;
+//    return false;
+//  }
+//
+//  FX_RECT rect = GetDrawRect();
+//  if (rect.IsEmpty())
+//    return false;
+//
+//  CFX_Matrix new_matrix = GetDrawMatrix(rect);
+//  CFX_DefaultRenderDevice bitmap_device1;
+//  if (!bitmap_device1.Create(rect.Width(), rect.Height(), FXDIB_Format::kRgb32,
+//                             nullptr)) {
+//    return true;
+//  }
+//#if defined(_SKIA_SUPPORT_)
+//  bitmap_device1.Clear(0xffffff);
+//#else
+//  bitmap_device1.GetBitmap()->Clear(0xffffff);
+//#endif
+//  CPDF_RenderStatus bitmap_render(m_pRenderStatus->GetContext(),
+//                                  &bitmap_device1);
+//  bitmap_render.SetDropObjects(m_pRenderStatus->GetDropObjects());
+//  bitmap_render.SetStdCS(true);
+//  bitmap_render.Initialize(nullptr, nullptr);
+//  CPDF_ImageRenderer image_render;
+//  if (image_render.Start(&bitmap_render, m_pDIBBase, 0, new_matrix,
+//                         m_ResampleOptions, true)) {
+//    image_render.Continue(nullptr);
+//  }
+//  CFX_DefaultRenderDevice bitmap_device2;
+//  if (!bitmap_device2.Create(rect.Width(), rect.Height(),
+//                             FXDIB_Format::k8bppRgb, nullptr)) {
+//    return true;
+//  }
+//#if defined(_SKIA_SUPPORT_)
+//  bitmap_device2.Clear(0);
+//#else
+//  bitmap_device2.GetBitmap()->Clear(0);
+//#endif
+//  CalculateDrawImage(&bitmap_device1, &bitmap_device2, m_Loader.GetMask(),
+//                     new_matrix, rect);
+//#if defined(_SKIA_SUPPORT_)
+//  m_pRenderStatus->GetRenderDevice()->SetBitsWithMask(
+//      bitmap_device1.GetBitmap(), bitmap_device2.GetBitmap(), rect.left,
+//      rect.top, m_BitmapAlpha, m_BlendType);
+//#else
+//  bitmap_device2.GetBitmap()->ConvertFormat(FXDIB_Format::k8bppMask);
+//  bitmap_device1.GetBitmap()->MultiplyAlpha(bitmap_device2.GetBitmap());
+//  if (m_BitmapAlpha < 255)
+//    bitmap_device1.GetBitmap()->MultiplyAlpha(m_BitmapAlpha);
+//  m_pRenderStatus->GetRenderDevice()->SetDIBitsWithBlend(
+//      bitmap_device1.GetBitmap(), rect.left, rect.top, m_BlendType);
+//#endif  //  defined(_SKIA_SUPPORT_)
   return false;
 }
 
 bool CPDF_ImageRenderer::StartDIBBase() {
-  if (m_pDIBBase->GetBPP() > 1) {
-    FX_SAFE_SIZE_T image_size = m_pDIBBase->GetBPP();
-    image_size /= 8;
-    image_size *= m_pDIBBase->GetWidth();
-    image_size *= m_pDIBBase->GetHeight();
-    if (!image_size.IsValid())
-      return false;
-
-    if (image_size.ValueOrDie() > kHugeImageSize &&
-        !m_ResampleOptions.bHalftone) {
-      m_ResampleOptions.bInterpolateBilinear = true;
-    }
-  }
-#if defined(_SKIA_SUPPORT_)
-  RetainPtr<CFX_DIBitmap> premultiplied = m_pDIBBase->Realize();
-  if (m_pDIBBase->IsAlphaFormat())
-    CFX_SkiaDeviceDriver::PreMultiply(premultiplied);
-  if (m_pRenderStatus->GetRenderDevice()->StartDIBitsWithBlend(
-          premultiplied, m_BitmapAlpha, m_FillArgb, m_ImageMatrix,
-          m_ResampleOptions, &m_DeviceHandle, m_BlendType)) {
-    if (m_DeviceHandle) {
-      m_Mode = Mode::kBlend;
-      return true;
-    }
-    return false;
-  }
-#else
-  if (m_pRenderStatus->GetRenderDevice()->StartDIBitsWithBlend(
-          m_pDIBBase, m_BitmapAlpha, m_FillArgb, m_ImageMatrix,
-          m_ResampleOptions, &m_DeviceHandle, m_BlendType)) {
-    if (m_DeviceHandle) {
-      m_Mode = Mode::kBlend;
-      return true;
-    }
-    return false;
-  }
-#endif  // defined(_SKIA_SUPPORT_)
-
-  if ((fabs(m_ImageMatrix.b) >= 0.5f || m_ImageMatrix.a == 0) ||
-      (fabs(m_ImageMatrix.c) >= 0.5f || m_ImageMatrix.d == 0)) {
-    if (NotDrawing()) {
-      m_Result = false;
-      return false;
-    }
-
-    absl::optional<FX_RECT> image_rect = GetUnitRect();
-    if (!image_rect.has_value())
-      return false;
-
-    FX_RECT clip_box = m_pRenderStatus->GetRenderDevice()->GetClipBox();
-    clip_box.Intersect(image_rect.value());
-    m_Mode = Mode::kTransform;
-    m_pTransformer = std::make_unique<CFX_ImageTransformer>(
-        m_pDIBBase, m_ImageMatrix, m_ResampleOptions, &clip_box);
-    return true;
-  }
-
-  absl::optional<FX_RECT> image_rect = GetUnitRect();
-  if (!image_rect.has_value())
-    return false;
-
-  int dest_left;
-  int dest_top;
-  int dest_width;
-  int dest_height;
-  if (!GetDimensionsFromUnitRect(image_rect.value(), &dest_left, &dest_top,
-                                 &dest_width, &dest_height)) {
-    return false;
-  }
-
-  if (m_pDIBBase->IsOpaqueImage() && m_BitmapAlpha == 255) {
-    if (m_pRenderStatus->GetRenderDevice()->StretchDIBitsWithFlagsAndBlend(
-            m_pDIBBase, dest_left, dest_top, dest_width, dest_height,
-            m_ResampleOptions, m_BlendType)) {
-      return false;
-    }
-  }
-  if (m_pDIBBase->IsMaskFormat()) {
-    if (m_BitmapAlpha != 255)
-      m_FillArgb = FXARGB_MUL_ALPHA(m_FillArgb, m_BitmapAlpha);
-    if (m_pRenderStatus->GetRenderDevice()->StretchBitMaskWithFlags(
-            m_pDIBBase, dest_left, dest_top, dest_width, dest_height,
-            m_FillArgb, m_ResampleOptions)) {
-      return false;
-    }
-  }
-  if (NotDrawing()) {
-    m_Result = false;
-    return true;
-  }
-
-  FX_RECT clip_box = m_pRenderStatus->GetRenderDevice()->GetClipBox();
-  FX_RECT dest_rect = clip_box;
-  dest_rect.Intersect(image_rect.value());
-  FX_RECT dest_clip(
-      dest_rect.left - image_rect->left, dest_rect.top - image_rect->top,
-      dest_rect.right - image_rect->left, dest_rect.bottom - image_rect->top);
-  RetainPtr<CFX_DIBitmap> pStretched = m_pDIBBase->StretchTo(
-      dest_width, dest_height, m_ResampleOptions, &dest_clip);
-  if (pStretched) {
-    m_pRenderStatus->CompositeDIBitmap(pStretched, dest_rect.left,
-                                       dest_rect.top, m_FillArgb, m_BitmapAlpha,
-                                       m_BlendType, CPDF_Transparency());
-  }
+//  if (m_pDIBBase->GetBPP() > 1) {
+//    FX_SAFE_SIZE_T image_size = m_pDIBBase->GetBPP();
+//    image_size /= 8;
+//    image_size *= m_pDIBBase->GetWidth();
+//    image_size *= m_pDIBBase->GetHeight();
+//    if (!image_size.IsValid())
+//      return false;
+//
+//    if (image_size.ValueOrDie() > kHugeImageSize &&
+//        !m_ResampleOptions.bHalftone) {
+//      m_ResampleOptions.bInterpolateBilinear = true;
+//    }
+//  }
+//#if defined(_SKIA_SUPPORT_)
+//  RetainPtr<CFX_DIBitmap> premultiplied = m_pDIBBase->Realize();
+//  if (m_pDIBBase->IsAlphaFormat())
+//    CFX_SkiaDeviceDriver::PreMultiply(premultiplied);
+//  if (m_pRenderStatus->GetRenderDevice()->StartDIBitsWithBlend(
+//          premultiplied, m_BitmapAlpha, m_FillArgb, m_ImageMatrix,
+//          m_ResampleOptions, &m_DeviceHandle, m_BlendType)) {
+//    if (m_DeviceHandle) {
+//      m_Mode = Mode::kBlend;
+//      return true;
+//    }
+//    return false;
+//  }
+//#else
+//  if (m_pRenderStatus->GetRenderDevice()->StartDIBitsWithBlend(
+//          m_pDIBBase, m_BitmapAlpha, m_FillArgb, m_ImageMatrix,
+//          m_ResampleOptions, &m_DeviceHandle, m_BlendType)) {
+//    if (m_DeviceHandle) {
+//      m_Mode = Mode::kBlend;
+//      return true;
+//    }
+//    return false;
+//  }
+//#endif  // defined(_SKIA_SUPPORT_)
+//
+//  if ((fabs(m_ImageMatrix.b) >= 0.5f || m_ImageMatrix.a == 0) ||
+//      (fabs(m_ImageMatrix.c) >= 0.5f || m_ImageMatrix.d == 0)) {
+//    if (NotDrawing()) {
+//      m_Result = false;
+//      return false;
+//    }
+//
+//    absl::optional<FX_RECT> image_rect = GetUnitRect();
+//    if (!image_rect.has_value())
+//      return false;
+//
+//    FX_RECT clip_box = m_pRenderStatus->GetRenderDevice()->GetClipBox();
+//    clip_box.Intersect(image_rect.value());
+//    m_Mode = Mode::kTransform;
+//    m_pTransformer = std::make_unique<CFX_ImageTransformer>(
+//        m_pDIBBase, m_ImageMatrix, m_ResampleOptions, &clip_box);
+//    return true;
+//  }
+//
+//  absl::optional<FX_RECT> image_rect = GetUnitRect();
+//  if (!image_rect.has_value())
+//    return false;
+//
+//  int dest_left;
+//  int dest_top;
+//  int dest_width;
+//  int dest_height;
+//  if (!GetDimensionsFromUnitRect(image_rect.value(), &dest_left, &dest_top,
+//                                 &dest_width, &dest_height)) {
+//    return false;
+//  }
+//
+//  if (m_pDIBBase->IsOpaqueImage() && m_BitmapAlpha == 255) {
+//    if (m_pRenderStatus->GetRenderDevice()->StretchDIBitsWithFlagsAndBlend(
+//            m_pDIBBase, dest_left, dest_top, dest_width, dest_height,
+//            m_ResampleOptions, m_BlendType)) {
+//      return false;
+//    }
+//  }
+//  if (m_pDIBBase->IsMaskFormat()) {
+//    if (m_BitmapAlpha != 255)
+//      m_FillArgb = FXARGB_MUL_ALPHA(m_FillArgb, m_BitmapAlpha);
+//    if (m_pRenderStatus->GetRenderDevice()->StretchBitMaskWithFlags(
+//            m_pDIBBase, dest_left, dest_top, dest_width, dest_height,
+//            m_FillArgb, m_ResampleOptions)) {
+//      return false;
+//    }
+//  }
+//  if (NotDrawing()) {
+//    m_Result = false;
+//    return true;
+//  }
+//
+//  FX_RECT clip_box = m_pRenderStatus->GetRenderDevice()->GetClipBox();
+//  FX_RECT dest_rect = clip_box;
+//  dest_rect.Intersect(image_rect.value());
+//  FX_RECT dest_clip(
+//      dest_rect.left - image_rect->left, dest_rect.top - image_rect->top,
+//      dest_rect.right - image_rect->left, dest_rect.bottom - image_rect->top);
+//  RetainPtr<CFX_DIBitmap> pStretched = m_pDIBBase->StretchTo(
+//      dest_width, dest_height, m_ResampleOptions, &dest_clip);
+//  if (pStretched) {
+//    m_pRenderStatus->CompositeDIBitmap(pStretched, dest_rect.left,
+//                                       dest_rect.top, m_FillArgb, m_BitmapAlpha,
+//                                       m_BlendType, CPDF_Transparency());
+//  }
   return false;
 }
 
 bool CPDF_ImageRenderer::StartBitmapAlpha() {
-  if (m_pDIBBase->IsOpaqueImage()) {
-    CFX_Path path;
-    path.AppendRect(0, 0, 1, 1);
-    path.Transform(m_ImageMatrix);
-    uint32_t fill_color =
-        ArgbEncode(0xff, m_BitmapAlpha, m_BitmapAlpha, m_BitmapAlpha);
-    m_pRenderStatus->GetRenderDevice()->DrawPath(
-        path, nullptr, nullptr, fill_color, 0,
-        CFX_FillRenderOptions::WindingOptions());
-    return false;
-  }
-  RetainPtr<CFX_DIBBase> pAlphaMask;
-  if (m_pDIBBase->IsMaskFormat())
-    pAlphaMask = m_pDIBBase;
-  else
-    pAlphaMask = m_pDIBBase->CloneAlphaMask();
-
-  if (fabs(m_ImageMatrix.b) >= 0.5f || fabs(m_ImageMatrix.c) >= 0.5f) {
-    int left;
-    int top;
-    RetainPtr<CFX_DIBitmap> pTransformed =
-        pAlphaMask->TransformTo(m_ImageMatrix, &left, &top);
-    if (!pTransformed)
-      return true;
-
-    m_pRenderStatus->GetRenderDevice()->SetBitMask(
-        pTransformed, left, top,
-        ArgbEncode(0xff, m_BitmapAlpha, m_BitmapAlpha, m_BitmapAlpha));
-    return false;
-  }
-
-  absl::optional<FX_RECT> image_rect = GetUnitRect();
-  if (!image_rect.has_value())
-    return false;
-
-  int left;
-  int top;
-  int dest_width;
-  int dest_height;
-  if (!GetDimensionsFromUnitRect(image_rect.value(), &left, &top, &dest_width,
-                                 &dest_height)) {
-    return false;
-  }
-
-  m_pRenderStatus->GetRenderDevice()->StretchBitMask(
-      pAlphaMask, left, top, dest_width, dest_height,
-      ArgbEncode(0xff, m_BitmapAlpha, m_BitmapAlpha, m_BitmapAlpha));
+  //if (m_pDIBBase->IsOpaqueImage()) {
+  //  CFX_Path path;
+  //  path.AppendRect(0, 0, 1, 1);
+  //  path.Transform(m_ImageMatrix);
+  //  uint32_t fill_color =
+  //      ArgbEncode(0xff, m_BitmapAlpha, m_BitmapAlpha, m_BitmapAlpha);
+  //  m_pRenderStatus->GetRenderDevice()->DrawPath(
+  //      path, nullptr, nullptr, fill_color, 0,
+  //      CFX_FillRenderOptions::WindingOptions());
+  //  return false;
+  //}
+  //RetainPtr<CFX_DIBBase> pAlphaMask;
+  //if (m_pDIBBase->IsMaskFormat())
+  //  pAlphaMask = m_pDIBBase;
+  //else
+  //  pAlphaMask = m_pDIBBase->CloneAlphaMask();
+
+  //if (fabs(m_ImageMatrix.b) >= 0.5f || fabs(m_ImageMatrix.c) >= 0.5f) {
+  //  int left;
+  //  int top;
+  //  RetainPtr<CFX_DIBitmap> pTransformed =
+  //      pAlphaMask->TransformTo(m_ImageMatrix, &left, &top);
+  //  if (!pTransformed)
+  //    return true;
+
+  //  m_pRenderStatus->GetRenderDevice()->SetBitMask(
+  //      pTransformed, left, top,
+  //      ArgbEncode(0xff, m_BitmapAlpha, m_BitmapAlpha, m_BitmapAlpha));
+  //  return false;
+  //}
+
+  //absl::optional<FX_RECT> image_rect = GetUnitRect();
+  //if (!image_rect.has_value())
+  //  return false;
+
+  //int left;
+  //int top;
+  //int dest_width;
+  //int dest_height;
+  //if (!GetDimensionsFromUnitRect(image_rect.value(), &left, &top, &dest_width,
+  //                               &dest_height)) {
+  //  return false;
+  //}
+
+  //m_pRenderStatus->GetRenderDevice()->StretchBitMask(
+  //    pAlphaMask, left, top, dest_width, dest_height,
+  //    ArgbEncode(0xff, m_BitmapAlpha, m_BitmapAlpha, m_BitmapAlpha));
   return false;
 }
 
@@ -565,31 +566,32 @@ bool CPDF_ImageRenderer::ContinueDefault(PauseIndicatorIface* pPause) {
 }
 
 bool CPDF_ImageRenderer::ContinueBlend(PauseIndicatorIface* pPause) {
-  return m_pRenderStatus->GetRenderDevice()->ContinueDIBits(
-      m_DeviceHandle.get(), pPause);
+  return false;
+  //m_pRenderStatus->GetRenderDevice()->ContinueDIBits(
+  //    m_DeviceHandle.get(), pPause);
 }
 
 bool CPDF_ImageRenderer::ContinueTransform(PauseIndicatorIface* pPause) {
-  if (m_pTransformer->Continue(pPause))
-    return true;
-
-  RetainPtr<CFX_DIBitmap> pBitmap = m_pTransformer->DetachBitmap();
-  if (!pBitmap)
-    return false;
-
-  if (pBitmap->IsMaskFormat()) {
-    if (m_BitmapAlpha != 255)
-      m_FillArgb = FXARGB_MUL_ALPHA(m_FillArgb, m_BitmapAlpha);
-    m_Result = m_pRenderStatus->GetRenderDevice()->SetBitMask(
-        pBitmap, m_pTransformer->result().left, m_pTransformer->result().top,
-        m_FillArgb);
-  } else {
-    if (m_BitmapAlpha != 255)
-      pBitmap->MultiplyAlpha(m_BitmapAlpha);
-    m_Result = m_pRenderStatus->GetRenderDevice()->SetDIBitsWithBlend(
-        pBitmap, m_pTransformer->result().left, m_pTransformer->result().top,
-        m_BlendType);
-  }
+//  if (m_pTransformer->Continue(pPause))
+  //  return true;
+
+  //RetainPtr<CFX_DIBitmap> pBitmap = m_pTransformer->DetachBitmap();
+  //if (!pBitmap)
+  //  return false;
+
+  //if (pBitmap->IsMaskFormat()) {
+  //  if (m_BitmapAlpha != 255)
+  //    m_FillArgb = FXARGB_MUL_ALPHA(m_FillArgb, m_BitmapAlpha);
+  //  m_Result = m_pRenderStatus->GetRenderDevice()->SetBitMask(
+  //      pBitmap, m_pTransformer->result().left, m_pTransformer->result().top,
+  //      m_FillArgb);
+  //} else {
+  //  if (m_BitmapAlpha != 255)
+  //    pBitmap->MultiplyAlpha(m_BitmapAlpha);
+  //  m_Result = m_pRenderStatus->GetRenderDevice()->SetDIBitsWithBlend(
+  //      pBitmap, m_pTransformer->result().left, m_pTransformer->result().top,
+  //      m_BlendType);
+  //}
   return false;
 }
 
diff --git a/core/fpdfapi/render/cpdf_imagerenderer.h b/core/fpdfapi/render/cpdf_imagerenderer.h
index faf842c63e..2406a83400 100644
--- a/core/fpdfapi/render/cpdf_imagerenderer.h
+++ b/core/fpdfapi/render/cpdf_imagerenderer.h
@@ -15,7 +15,7 @@
 #include "core/fxcrt/unowned_ptr.h"
 #include "core/fxge/dib/cfx_imagerenderer.h"
 #include "core/fxge/dib/fx_dib.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CFX_DIBBase;
 class CFX_DefaultRenderDevice;
diff --git a/core/fpdfapi/render/cpdf_rendercontext.cpp b/core/fpdfapi/render/cpdf_rendercontext.cpp
index 3e885f0ef0..768bfcf451 100644
--- a/core/fpdfapi/render/cpdf_rendercontext.cpp
+++ b/core/fpdfapi/render/cpdf_rendercontext.cpp
@@ -15,7 +15,7 @@
 #include "core/fpdfapi/render/cpdf_renderoptions.h"
 #include "core/fpdfapi/render/cpdf_renderstatus.h"
 #include "core/fpdfapi/render/cpdf_textrenderer.h"
-#include "core/fxge/cfx_defaultrenderdevice.h"
+//#include "core/fxge/cfx_defaultrenderdevice.h"
 #include "core/fxge/cfx_renderdevice.h"
 #include "core/fxge/dib/cfx_dibitmap.h"
 #include "core/fxge/dib/fx_dib.h"
@@ -33,12 +33,12 @@ void CPDF_RenderContext::GetBackground(const RetainPtr<CFX_DIBitmap>& pBuffer,
                                        const CPDF_PageObject* pObj,
                                        const CPDF_RenderOptions* pOptions,
                                        const CFX_Matrix& mtFinal) {
-  CFX_DefaultRenderDevice device;
-  device.Attach(pBuffer, false, nullptr, false);
+  //CFX_DefaultRenderDevice device;
+  //device.Attach(pBuffer, false, nullptr, false);
 
-  device.FillRect(FX_RECT(0, 0, device.GetWidth(), device.GetHeight()),
-                  0xffffffff);
-  Render(&device, pObj, pOptions, &mtFinal);
+  //device.FillRect(FX_RECT(0, 0, device.GetWidth(), device.GetHeight()),
+  //                0xffffffff);
+  //Render(&device, pObj, pOptions, &mtFinal);
 }
 
 void CPDF_RenderContext::AppendLayer(CPDF_PageObjectHolder* pObjectHolder,
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index a27f2ad8b1..635fd6bc19 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -54,7 +54,7 @@
 #include "core/fxcrt/fx_safe_types.h"
 #include "core/fxcrt/fx_system.h"
 #include "core/fxcrt/unowned_ptr.h"
-#include "core/fxge/cfx_defaultrenderdevice.h"
+//#include "core/fxge/cfx_defaultrenderdevice.h"
 #include "core/fxge/cfx_fillrenderoptions.h"
 #include "core/fxge/cfx_glyphbitmap.h"
 #include "core/fxge/cfx_path.h"
@@ -144,156 +144,157 @@ bool Type3CharMissingStrokeColor(const CPDF_Type3Char* pChar,
   return pChar && (!pChar->colored() || MissingStrokeColor(pColorState));
 }
 
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
-class ScopedSkiaDeviceFlush {
- public:
-  FX_STACK_ALLOCATED();
-
-  explicit ScopedSkiaDeviceFlush(CFX_RenderDevice* pDevice)
-      : m_pDevice(pDevice) {}
-
-  ScopedSkiaDeviceFlush(const ScopedSkiaDeviceFlush&) = delete;
-  ScopedSkiaDeviceFlush& operator=(const ScopedSkiaDeviceFlush&) = delete;
-
-  ~ScopedSkiaDeviceFlush() { m_pDevice->Flush(/*release=*/false); }
-
- private:
-  UnownedPtr<CFX_RenderDevice> const m_pDevice;
-};
-#endif
+//#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+//class ScopedSkiaDeviceFlush {
+// public:
+//  FX_STACK_ALLOCATED();
+//
+//  explicit ScopedSkiaDeviceFlush(CFX_RenderDevice* pDevice)
+//      : m_pDevice(pDevice) {}
+//
+//  ScopedSkiaDeviceFlush(const ScopedSkiaDeviceFlush&) = delete;
+//  ScopedSkiaDeviceFlush& operator=(const ScopedSkiaDeviceFlush&) = delete;
+//
+//  ~ScopedSkiaDeviceFlush() { m_pDevice->Flush(/*release=*/false); }
+//
+// private:
+//  UnownedPtr<CFX_RenderDevice> const m_pDevice;
+//};
+//#endif
 
 }  // namespace
 
 CPDF_RenderStatus::CPDF_RenderStatus(CPDF_RenderContext* pContext,
                                      CFX_RenderDevice* pDevice)
-    : m_pContext(pContext), m_pDevice(pDevice) {}
+    : m_pContext(pContext)//, m_pDevice(pDevice) 
+{}
 
 CPDF_RenderStatus::~CPDF_RenderStatus() = default;
 
 void CPDF_RenderStatus::Initialize(const CPDF_RenderStatus* pParentStatus,
                                    const CPDF_GraphicStates* pInitialStates) {
-  m_bPrint = m_pDevice->GetDeviceType() != DeviceType::kDisplay;
-  m_pPageResource.Reset(m_pContext->GetPageResources());
-  if (pInitialStates && !m_pType3Char) {
-    m_InitialStates.CopyStates(*pInitialStates);
-    if (pParentStatus) {
-      if (!m_InitialStates.m_ColorState.HasFillColor()) {
-        m_InitialStates.m_ColorState.SetFillColorRef(
-            pParentStatus->m_InitialStates.m_ColorState.GetFillColorRef());
-        *m_InitialStates.m_ColorState.GetMutableFillColor() =
-            *pParentStatus->m_InitialStates.m_ColorState.GetFillColor();
-      }
-      if (!m_InitialStates.m_ColorState.HasStrokeColor()) {
-        m_InitialStates.m_ColorState.SetStrokeColorRef(
-            pParentStatus->m_InitialStates.m_ColorState.GetFillColorRef());
-        *m_InitialStates.m_ColorState.GetMutableStrokeColor() =
-            *pParentStatus->m_InitialStates.m_ColorState.GetStrokeColor();
-      }
-    }
-  } else {
-    m_InitialStates.DefaultStates();
-  }
+  //m_bPrint = m_pDevice->GetDeviceType() != DeviceType::kDisplay;
+  //m_pPageResource.Reset(m_pContext->GetPageResources());
+  //if (pInitialStates && !m_pType3Char) {
+  //  m_InitialStates.CopyStates(*pInitialStates);
+  //  if (pParentStatus) {
+  //    if (!m_InitialStates.m_ColorState.HasFillColor()) {
+  //      m_InitialStates.m_ColorState.SetFillColorRef(
+  //          pParentStatus->m_InitialStates.m_ColorState.GetFillColorRef());
+  //      *m_InitialStates.m_ColorState.GetMutableFillColor() =
+  //          *pParentStatus->m_InitialStates.m_ColorState.GetFillColor();
+  //    }
+  //    if (!m_InitialStates.m_ColorState.HasStrokeColor()) {
+  //      m_InitialStates.m_ColorState.SetStrokeColorRef(
+  //          pParentStatus->m_InitialStates.m_ColorState.GetFillColorRef());
+  //      *m_InitialStates.m_ColorState.GetMutableStrokeColor() =
+  //          *pParentStatus->m_InitialStates.m_ColorState.GetStrokeColor();
+  //    }
+  //  }
+  //} else {
+  //  m_InitialStates.DefaultStates();
+  //}
 }
 
 void CPDF_RenderStatus::RenderObjectList(
     const CPDF_PageObjectHolder* pObjectHolder,
     const CFX_Matrix& mtObj2Device) {
-#if defined(_SKIA_SUPPORT_)
-  DebugVerifyDeviceIsPreMultiplied();
-#endif
-  CFX_FloatRect clip_rect = mtObj2Device.GetInverse().TransformRect(
-      CFX_FloatRect(m_pDevice->GetClipBox()));
-  for (const auto& pCurObj : *pObjectHolder) {
-    if (pCurObj.get() == m_pStopObj) {
-      m_bStopped = true;
-      return;
-    }
-    if (!pCurObj)
-      continue;
-
-    if (pCurObj->GetRect().left > clip_rect.right ||
-        pCurObj->GetRect().right < clip_rect.left ||
-        pCurObj->GetRect().bottom > clip_rect.top ||
-        pCurObj->GetRect().top < clip_rect.bottom) {
-      continue;
-    }
-    RenderSingleObject(pCurObj.get(), mtObj2Device);
-    if (m_bStopped)
-      return;
-  }
-#if defined(_SKIA_SUPPORT_)
-  DebugVerifyDeviceIsPreMultiplied();
-#endif
+//#if defined(_SKIA_SUPPORT_)
+//  DebugVerifyDeviceIsPreMultiplied();
+//#endif
+//  CFX_FloatRect clip_rect = mtObj2Device.GetInverse().TransformRect(
+//      CFX_FloatRect(m_pDevice->GetClipBox()));
+//  for (const auto& pCurObj : *pObjectHolder) {
+//    if (pCurObj.get() == m_pStopObj) {
+//      m_bStopped = true;
+//      return;
+//    }
+//    if (!pCurObj)
+//      continue;
+//
+//    if (pCurObj->GetRect().left > clip_rect.right ||
+//        pCurObj->GetRect().right < clip_rect.left ||
+//        pCurObj->GetRect().bottom > clip_rect.top ||
+//        pCurObj->GetRect().top < clip_rect.bottom) {
+//      continue;
+//    }
+//    RenderSingleObject(pCurObj.get(), mtObj2Device);
+//    if (m_bStopped)
+//      return;
+//  }
+//#if defined(_SKIA_SUPPORT_)
+//  DebugVerifyDeviceIsPreMultiplied();
+//#endif
 }
 
 void CPDF_RenderStatus::RenderSingleObject(CPDF_PageObject* pObj,
                                            const CFX_Matrix& mtObj2Device) {
-#if defined(_SKIA_SUPPORT_)
-  DebugVerifyDeviceIsPreMultiplied();
-#endif
-  AutoRestorer<int> restorer(&g_CurrentRecursionDepth);
-  if (++g_CurrentRecursionDepth > kRenderMaxRecursionDepth) {
-    return;
-  }
-  m_pCurObj = pObj;
-  if (m_Options.GetOCContext() &&
-      !m_Options.GetOCContext()->CheckObjectVisible(pObj)) {
-    return;
-  }
-  ProcessClipPath(pObj->m_ClipPath, mtObj2Device);
-  if (ProcessTransparency(pObj, mtObj2Device)) {
-    return;
-  }
-  ProcessObjectNoClip(pObj, mtObj2Device);
-#if defined(_SKIA_SUPPORT_)
-  DebugVerifyDeviceIsPreMultiplied();
-#endif
+//#if defined(_SKIA_SUPPORT_)
+//  DebugVerifyDeviceIsPreMultiplied();
+//#endif
+//  AutoRestorer<int> restorer(&g_CurrentRecursionDepth);
+//  if (++g_CurrentRecursionDepth > kRenderMaxRecursionDepth) {
+//    return;
+//  }
+//  m_pCurObj = pObj;
+//  if (m_Options.GetOCContext() &&
+//      !m_Options.GetOCContext()->CheckObjectVisible(pObj)) {
+//    return;
+//  }
+//  ProcessClipPath(pObj->m_ClipPath, mtObj2Device);
+//  if (ProcessTransparency(pObj, mtObj2Device)) {
+//    return;
+//  }
+//  ProcessObjectNoClip(pObj, mtObj2Device);
+//#if defined(_SKIA_SUPPORT_)
+//  DebugVerifyDeviceIsPreMultiplied();
+//#endif
 }
 
 bool CPDF_RenderStatus::ContinueSingleObject(CPDF_PageObject* pObj,
                                              const CFX_Matrix& mtObj2Device,
                                              PauseIndicatorIface* pPause) {
-  if (m_pImageRenderer) {
-    if (m_pImageRenderer->Continue(pPause))
-      return true;
-
-    if (!m_pImageRenderer->GetResult())
-      DrawObjWithBackground(pObj, mtObj2Device);
-    m_pImageRenderer.reset();
-    return false;
-  }
-
-  m_pCurObj = pObj;
-  if (m_Options.GetOCContext() &&
-      !m_Options.GetOCContext()->CheckObjectVisible(pObj)) {
-    return false;
-  }
+  //if (m_pImageRenderer) {
+  //  if (m_pImageRenderer->Continue(pPause))
+  //    return true;
 
-  ProcessClipPath(pObj->m_ClipPath, mtObj2Device);
-  if (ProcessTransparency(pObj, mtObj2Device))
+  //  if (!m_pImageRenderer->GetResult())
+  //    DrawObjWithBackground(pObj, mtObj2Device);
+  //  m_pImageRenderer.reset();
     return false;
-
-  if (!pObj->IsImage()) {
-    ProcessObjectNoClip(pObj, mtObj2Device);
-    return false;
-  }
-
-  m_pImageRenderer = std::make_unique<CPDF_ImageRenderer>();
-  if (!m_pImageRenderer->Start(this, pObj->AsImage(), mtObj2Device, false,
-                               BlendMode::kNormal)) {
-    if (!m_pImageRenderer->GetResult())
-      DrawObjWithBackground(pObj, mtObj2Device);
-    m_pImageRenderer.reset();
-    return false;
-  }
-  return ContinueSingleObject(pObj, mtObj2Device, pPause);
+  //}
+
+  //m_pCurObj = pObj;
+  //if (m_Options.GetOCContext() &&
+  //    !m_Options.GetOCContext()->CheckObjectVisible(pObj)) {
+  //  return false;
+  //}
+
+  //ProcessClipPath(pObj->m_ClipPath, mtObj2Device);
+  //if (ProcessTransparency(pObj, mtObj2Device))
+  //  return false;
+
+  //if (!pObj->IsImage()) {
+  //  ProcessObjectNoClip(pObj, mtObj2Device);
+  //  return false;
+  //}
+
+  //m_pImageRenderer = std::make_unique<CPDF_ImageRenderer>();
+  //if (!m_pImageRenderer->Start(this, pObj->AsImage(), mtObj2Device, false,
+  //                             BlendMode::kNormal)) {
+  //  if (!m_pImageRenderer->GetResult())
+  //    DrawObjWithBackground(pObj, mtObj2Device);
+  //  m_pImageRenderer.reset();
+  //  return false;
+  //}
+  //return ContinueSingleObject(pObj, mtObj2Device, pPause);
 }
 
 FX_RECT CPDF_RenderStatus::GetObjectClippedRect(
     const CPDF_PageObject* pObj,
     const CFX_Matrix& mtObj2Device) const {
   FX_RECT rect = pObj->GetTransformedBBox(mtObj2Device);
-  rect.Intersect(m_pDevice->GetClipBox());
+  //rect.Intersect(m_pDevice->GetClipBox());
   return rect;
 }
 
@@ -343,96 +344,97 @@ bool CPDF_RenderStatus::DrawObjWithBlend(CPDF_PageObject* pObj,
 
 void CPDF_RenderStatus::DrawObjWithBackground(CPDF_PageObject* pObj,
                                               const CFX_Matrix& mtObj2Device) {
-  FX_RECT rect = GetObjectClippedRect(pObj, mtObj2Device);
-  if (rect.IsEmpty())
-    return;
-
-  int res = (pObj->IsImage() && m_bPrint) ? 0 : 300;
-  CPDF_ScaledRenderBuffer buffer;
-  if (!buffer.Initialize(m_pContext.Get(), m_pDevice, rect, pObj, &m_Options,
-                         res)) {
-    return;
-  }
-  CFX_Matrix matrix = mtObj2Device * buffer.GetMatrix();
-  const CPDF_Dictionary* pFormResource = nullptr;
-  const CPDF_FormObject* pFormObj = pObj->AsForm();
-  if (pFormObj)
-    pFormResource = pFormObj->form()->GetDict()->GetDictFor("Resources");
-  CPDF_RenderStatus status(m_pContext.Get(), buffer.GetDevice());
-  status.SetOptions(m_Options);
-  status.SetDeviceMatrix(buffer.GetMatrix());
-  status.SetTransparency(m_Transparency);
-  status.SetDropObjects(m_bDropObjects);
-  status.SetFormResource(pFormResource);
-  status.Initialize(nullptr, nullptr);
-  status.RenderSingleObject(pObj, matrix);
-  buffer.OutputToDevice();
+  //FX_RECT rect = GetObjectClippedRect(pObj, mtObj2Device);
+  //if (rect.IsEmpty())
+  //  return;
+
+  //int res = (pObj->IsImage() && m_bPrint) ? 0 : 300;
+  //CPDF_ScaledRenderBuffer buffer;
+  //if (!buffer.Initialize(m_pContext.Get(), m_pDevice, rect, pObj, &m_Options,
+  //                       res)) {
+  //  return;
+  //}
+  //CFX_Matrix matrix = mtObj2Device * buffer.GetMatrix();
+  //const CPDF_Dictionary* pFormResource = nullptr;
+  //const CPDF_FormObject* pFormObj = pObj->AsForm();
+  //if (pFormObj)
+  //  pFormResource = pFormObj->form()->GetDict()->GetDictFor("Resources");
+  //CPDF_RenderStatus status(m_pContext.Get(), buffer.GetDevice());
+  //status.SetOptions(m_Options);
+  //status.SetDeviceMatrix(buffer.GetMatrix());
+  //status.SetTransparency(m_Transparency);
+  //status.SetDropObjects(m_bDropObjects);
+  //status.SetFormResource(pFormResource);
+  //status.Initialize(nullptr, nullptr);
+  //status.RenderSingleObject(pObj, matrix);
+  //buffer.OutputToDevice();
 }
 
 bool CPDF_RenderStatus::ProcessForm(const CPDF_FormObject* pFormObj,
                                     const CFX_Matrix& mtObj2Device) {
-#if defined(_SKIA_SUPPORT_)
-  DebugVerifyDeviceIsPreMultiplied();
-#endif
-  const CPDF_Dictionary* pOC = pFormObj->form()->GetDict()->GetDictFor("OC");
-  if (pOC && m_Options.GetOCContext() &&
-      !m_Options.GetOCContext()->CheckOCGVisible(pOC)) {
-    return true;
-  }
-  CFX_Matrix matrix = pFormObj->form_matrix() * mtObj2Device;
-  const CPDF_Dictionary* pResources =
-      pFormObj->form()->GetDict()->GetDictFor("Resources");
-  CPDF_RenderStatus status(m_pContext.Get(), m_pDevice);
-  status.SetOptions(m_Options);
-  status.SetStopObject(m_pStopObj.Get());
-  status.SetTransparency(m_Transparency);
-  status.SetDropObjects(m_bDropObjects);
-  status.SetFormResource(pResources);
-  status.Initialize(this, pFormObj);
-  status.m_curBlend = m_curBlend;
-  {
-    CFX_RenderDevice::StateRestorer restorer(m_pDevice);
-    status.RenderObjectList(pFormObj->form(), matrix);
-    m_bStopped = status.m_bStopped;
-  }
-#if defined(_SKIA_SUPPORT_)
-  DebugVerifyDeviceIsPreMultiplied();
-#endif
+//#if defined(_SKIA_SUPPORT_)
+//  DebugVerifyDeviceIsPreMultiplied();
+//#endif
+//  const CPDF_Dictionary* pOC = pFormObj->form()->GetDict()->GetDictFor("OC");
+//  if (pOC && m_Options.GetOCContext() &&
+//      !m_Options.GetOCContext()->CheckOCGVisible(pOC)) {
+//    return true;
+//  }
+//  CFX_Matrix matrix = pFormObj->form_matrix() * mtObj2Device;
+//  const CPDF_Dictionary* pResources =
+//      pFormObj->form()->GetDict()->GetDictFor("Resources");
+//  CPDF_RenderStatus status(m_pContext.Get(), m_pDevice);
+//  status.SetOptions(m_Options);
+//  status.SetStopObject(m_pStopObj.Get());
+//  status.SetTransparency(m_Transparency);
+//  status.SetDropObjects(m_bDropObjects);
+//  status.SetFormResource(pResources);
+//  status.Initialize(this, pFormObj);
+//  status.m_curBlend = m_curBlend;
+//  {
+//    CFX_RenderDevice::StateRestorer restorer(m_pDevice);
+//    status.RenderObjectList(pFormObj->form(), matrix);
+//    m_bStopped = status.m_bStopped;
+//  }
+//#if defined(_SKIA_SUPPORT_)
+//  DebugVerifyDeviceIsPreMultiplied();
+//#endif
   return true;
 }
 
 bool CPDF_RenderStatus::ProcessPath(CPDF_PathObject* path_obj,
                                     const CFX_Matrix& mtObj2Device) {
-  CFX_FillRenderOptions::FillType fill_type = path_obj->filltype();
-  bool stroke = path_obj->stroke();
-  ProcessPathPattern(path_obj, mtObj2Device, &fill_type, &stroke);
-  if (fill_type == CFX_FillRenderOptions::FillType::kNoFill && !stroke)
-    return true;
-
-  // If the option to convert fill paths to stroke is enabled for forced color,
-  // set |fill_type| to FillType::kNoFill and |stroke| to true.
-  CPDF_RenderOptions::Options& options = m_Options.GetOptions();
-  if (m_Options.ColorModeIs(CPDF_RenderOptions::Type::kForcedColor) &&
-      options.bConvertFillToStroke &&
-      fill_type != CFX_FillRenderOptions::FillType::kNoFill) {
-    stroke = true;
-    fill_type = CFX_FillRenderOptions::FillType::kNoFill;
-  }
-
-  uint32_t fill_argb = fill_type != CFX_FillRenderOptions::FillType::kNoFill
-                           ? GetFillArgb(path_obj)
-                           : 0;
-  uint32_t stroke_argb = stroke ? GetStrokeArgb(path_obj) : 0;
-  CFX_Matrix path_matrix = path_obj->matrix() * mtObj2Device;
-  if (!IsAvailableMatrix(path_matrix))
-    return true;
-
-  return m_pDevice->DrawPathWithBlend(
-      *path_obj->path().GetObject(), &path_matrix,
-      path_obj->m_GraphState.GetObject(), fill_argb, stroke_argb,
-      GetFillOptionsForDrawPathWithBlend(options, path_obj, fill_type, stroke,
-                                         m_pType3Char),
-      m_curBlend);
+  //CFX_FillRenderOptions::FillType fill_type = path_obj->filltype();
+  //bool stroke = path_obj->stroke();
+  //ProcessPathPattern(path_obj, mtObj2Device, &fill_type, &stroke);
+  //if (fill_type == CFX_FillRenderOptions::FillType::kNoFill && !stroke)
+  //  return true;
+
+  //// If the option to convert fill paths to stroke is enabled for forced color,
+  //// set |fill_type| to FillType::kNoFill and |stroke| to true.
+  //CPDF_RenderOptions::Options& options = m_Options.GetOptions();
+  //if (m_Options.ColorModeIs(CPDF_RenderOptions::Type::kForcedColor) &&
+  //    options.bConvertFillToStroke &&
+  //    fill_type != CFX_FillRenderOptions::FillType::kNoFill) {
+  //  stroke = true;
+  //  fill_type = CFX_FillRenderOptions::FillType::kNoFill;
+  //}
+
+  //uint32_t fill_argb = fill_type != CFX_FillRenderOptions::FillType::kNoFill
+  //                         ? GetFillArgb(path_obj)
+  //                         : 0;
+  //uint32_t stroke_argb = stroke ? GetStrokeArgb(path_obj) : 0;
+  //CFX_Matrix path_matrix = path_obj->matrix() * mtObj2Device;
+  //if (!IsAvailableMatrix(path_matrix))
+  //  return true;
+
+  //return m_pDevice->DrawPathWithBlend(
+  //    *path_obj->path().GetObject(), &path_matrix,
+  //    path_obj->m_GraphState.GetObject(), fill_argb, stroke_argb,
+  //    GetFillOptionsForDrawPathWithBlend(options, path_obj, fill_type, stroke,
+  //                                       m_pType3Char),
+  //    m_curBlend);
+  return true;
 }
 
 RetainPtr<CPDF_TransferFunc> CPDF_RenderStatus::GetTransferFunc(
@@ -506,63 +508,63 @@ FX_ARGB CPDF_RenderStatus::GetStrokeArgb(CPDF_PageObject* pObj) const {
 
 void CPDF_RenderStatus::ProcessClipPath(const CPDF_ClipPath& ClipPath,
                                         const CFX_Matrix& mtObj2Device) {
-  if (!ClipPath.HasRef()) {
-    if (m_LastClipPath.HasRef()) {
-      m_pDevice->RestoreState(true);
-      m_LastClipPath.SetNull();
-    }
-    return;
-  }
-  if (m_LastClipPath == ClipPath)
-    return;
-
-  m_LastClipPath = ClipPath;
-  m_pDevice->RestoreState(true);
-  for (size_t i = 0; i < ClipPath.GetPathCount(); ++i) {
-    const CFX_Path* pPath = ClipPath.GetPath(i).GetObject();
-    if (!pPath)
-      continue;
-
-    if (pPath->GetPoints().empty()) {
-      CFX_Path empty_path;
-      empty_path.AppendRect(-1, -1, 0, 0);
-      m_pDevice->SetClip_PathFill(empty_path, nullptr,
-                                  CFX_FillRenderOptions::WindingOptions());
-    } else {
-      m_pDevice->SetClip_PathFill(
-          *pPath, &mtObj2Device,
-          CFX_FillRenderOptions(ClipPath.GetClipType(i)));
-    }
-  }
-
-  if (ClipPath.GetTextCount() == 0)
-    return;
-
-  if (!m_bPrint &&
-      !(m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_SOFT_CLIP)) {
-    return;
-  }
-
-  std::unique_ptr<CFX_Path> pTextClippingPath;
-  for (size_t i = 0; i < ClipPath.GetTextCount(); ++i) {
-    CPDF_TextObject* pText = ClipPath.GetText(i);
-    if (pText) {
-      if (!pTextClippingPath)
-        pTextClippingPath = std::make_unique<CFX_Path>();
-      ProcessText(pText, mtObj2Device, pTextClippingPath.get());
-      continue;
-    }
-
-    if (!pTextClippingPath)
-      continue;
-
-    CFX_FillRenderOptions fill_options(CFX_FillRenderOptions::WindingOptions());
-    if (m_Options.GetOptions().bNoTextSmooth)
-      fill_options.aliased_path = true;
-    m_pDevice->SetClip_PathFill(*pTextClippingPath.get(), nullptr,
-                                fill_options);
-    pTextClippingPath.reset();
-  }
+  //if (!ClipPath.HasRef()) {
+  //  if (m_LastClipPath.HasRef()) {
+  //    m_pDevice->RestoreState(true);
+  //    m_LastClipPath.SetNull();
+  //  }
+  //  return;
+  //}
+  //if (m_LastClipPath == ClipPath)
+  //  return;
+
+  //m_LastClipPath = ClipPath;
+  //m_pDevice->RestoreState(true);
+  //for (size_t i = 0; i < ClipPath.GetPathCount(); ++i) {
+  //  const CFX_Path* pPath = ClipPath.GetPath(i).GetObject();
+  //  if (!pPath)
+  //    continue;
+
+  //  if (pPath->GetPoints().empty()) {
+  //    CFX_Path empty_path;
+  //    empty_path.AppendRect(-1, -1, 0, 0);
+  //    m_pDevice->SetClip_PathFill(empty_path, nullptr,
+  //                                CFX_FillRenderOptions::WindingOptions());
+  //  } else {
+  //    m_pDevice->SetClip_PathFill(
+  //        *pPath, &mtObj2Device,
+  //        CFX_FillRenderOptions(ClipPath.GetClipType(i)));
+  //  }
+  //}
+
+  //if (ClipPath.GetTextCount() == 0)
+  //  return;
+
+  //if (!m_bPrint &&
+  //    !(m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_SOFT_CLIP)) {
+  //  return;
+  //}
+
+  //std::unique_ptr<CFX_Path> pTextClippingPath;
+  //for (size_t i = 0; i < ClipPath.GetTextCount(); ++i) {
+  //  CPDF_TextObject* pText = ClipPath.GetText(i);
+  //  if (pText) {
+  //    if (!pTextClippingPath)
+  //      pTextClippingPath = std::make_unique<CFX_Path>();
+  //    ProcessText(pText, mtObj2Device, pTextClippingPath.get());
+  //    continue;
+  //  }
+
+  //  if (!pTextClippingPath)
+  //    continue;
+
+  //  CFX_FillRenderOptions fill_options(CFX_FillRenderOptions::WindingOptions());
+  //  if (m_Options.GetOptions().bNoTextSmooth)
+  //    fill_options.aliased_path = true;
+  //  m_pDevice->SetClip_PathFill(*pTextClippingPath.get(), nullptr,
+  //                              fill_options);
+  //  pTextClippingPath.reset();
+  //}
 }
 
 bool CPDF_RenderStatus::ClipPattern(const CPDF_PageObject* page_obj,
@@ -571,7 +573,7 @@ bool CPDF_RenderStatus::ClipPattern(const CPDF_PageObject* page_obj,
   if (page_obj->IsPath())
     return SelectClipPath(page_obj->AsPath(), mtObj2Device, stroke);
   if (page_obj->IsImage()) {
-    m_pDevice->SetClip_Rect(page_obj->GetTransformedBBox(mtObj2Device));
+    //m_pDevice->SetClip_Rect(page_obj->GetTransformedBBox(mtObj2Device));
     return true;
   }
   return false;
@@ -580,164 +582,165 @@ bool CPDF_RenderStatus::ClipPattern(const CPDF_PageObject* page_obj,
 bool CPDF_RenderStatus::SelectClipPath(const CPDF_PathObject* path_obj,
                                        const CFX_Matrix& mtObj2Device,
                                        bool stroke) {
-  CFX_Matrix path_matrix = path_obj->matrix() * mtObj2Device;
-  if (stroke) {
-    return m_pDevice->SetClip_PathStroke(*path_obj->path().GetObject(),
-                                         &path_matrix,
-                                         path_obj->m_GraphState.GetObject());
-  }
-  CFX_FillRenderOptions fill_options(path_obj->filltype());
-  if (m_Options.GetOptions().bNoPathSmooth) {
-    fill_options.aliased_path = true;
-  }
-  return m_pDevice->SetClip_PathFill(*path_obj->path().GetObject(),
-                                     &path_matrix, fill_options);
+  //CFX_Matrix path_matrix = path_obj->matrix() * mtObj2Device;
+  //if (stroke) {
+  //  return m_pDevice->SetClip_PathStroke(*path_obj->path().GetObject(),
+  //                                       &path_matrix,
+  //                                       path_obj->m_GraphState.GetObject());
+  //}
+  //CFX_FillRenderOptions fill_options(path_obj->filltype());
+  //if (m_Options.GetOptions().bNoPathSmooth) {
+  //  fill_options.aliased_path = true;
+  //}
+  //return m_pDevice->SetClip_PathFill(*path_obj->path().GetObject(),
+  //                                   &path_matrix, fill_options);
+  return true;
 }
 
 bool CPDF_RenderStatus::ProcessTransparency(CPDF_PageObject* pPageObj,
                                             const CFX_Matrix& mtObj2Device) {
-#if defined(_SKIA_SUPPORT_)
-  DebugVerifyDeviceIsPreMultiplied();
-#endif
-  const BlendMode blend_type = pPageObj->m_GeneralState.GetBlendType();
-  CPDF_Dictionary* pSMaskDict =
-      ToDictionary(pPageObj->m_GeneralState.GetSoftMask());
-  if (pSMaskDict) {
-    if (pPageObj->IsImage() &&
-        pPageObj->AsImage()->GetImage()->GetDict()->KeyExist("SMask")) {
-      pSMaskDict = nullptr;
-    }
-  }
-  const CPDF_Dictionary* pFormResource = nullptr;
-  float group_alpha = 1.0f;
-  CPDF_Transparency transparency = m_Transparency;
-  bool bGroupTransparent = false;
-  const CPDF_FormObject* pFormObj = pPageObj->AsForm();
-  if (pFormObj) {
-    group_alpha = pFormObj->m_GeneralState.GetFillAlpha();
-    transparency = pFormObj->form()->GetTransparency();
-    bGroupTransparent = transparency.IsIsolated();
-    pFormResource = pFormObj->form()->GetDict()->GetDictFor("Resources");
-  }
-  bool bTextClip =
-      (pPageObj->m_ClipPath.HasRef() &&
-       pPageObj->m_ClipPath.GetTextCount() > 0 && !m_bPrint &&
-       !(m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_SOFT_CLIP));
-  if (!pSMaskDict && group_alpha == 1.0f && blend_type == BlendMode::kNormal &&
-      !bTextClip && !bGroupTransparent) {
-    return false;
-  }
-  if (m_bPrint) {
-    bool bRet = false;
-    int rendCaps = m_pDevice->GetRenderCaps();
-    if (!(transparency.IsIsolated() || pSMaskDict || bTextClip) &&
-        (rendCaps & FXRC_BLEND_MODE)) {
-      BlendMode oldBlend = m_curBlend;
-      m_curBlend = blend_type;
-      bRet = DrawObjWithBlend(pPageObj, mtObj2Device);
-      m_curBlend = oldBlend;
-    }
-    if (!bRet) {
-      DrawObjWithBackground(pPageObj, mtObj2Device);
-    }
-    return true;
-  }
-  FX_RECT rect = pPageObj->GetTransformedBBox(mtObj2Device);
-  rect.Intersect(m_pDevice->GetClipBox());
-  if (rect.IsEmpty())
-    return true;
-
-  int width = rect.Width();
-  int height = rect.Height();
-  CFX_DefaultRenderDevice bitmap_device;
-  RetainPtr<CFX_DIBitmap> backdrop;
-  if (!transparency.IsIsolated() &&
-      (m_pDevice->GetRenderCaps() & FXRC_GET_BITS)) {
-    backdrop = pdfium::MakeRetain<CFX_DIBitmap>();
-    if (!m_pDevice->CreateCompatibleBitmap(backdrop, width, height))
-      return true;
-    m_pDevice->GetDIBits(backdrop, rect.left, rect.top);
-  }
-  if (!bitmap_device.Create(width, height, FXDIB_Format::kArgb, backdrop))
-    return true;
-
-  RetainPtr<CFX_DIBitmap> bitmap = bitmap_device.GetBitmap();
-  bitmap->Clear(0);
-
-  CFX_Matrix new_matrix = mtObj2Device;
-  new_matrix.Translate(-rect.left, -rect.top);
-
-  RetainPtr<CFX_DIBitmap> pTextMask;
-  if (bTextClip) {
-    pTextMask = pdfium::MakeRetain<CFX_DIBitmap>();
-    if (!pTextMask->Create(width, height, FXDIB_Format::k8bppMask))
-      return true;
-
-    pTextMask->Clear(0);
-    CFX_DefaultRenderDevice text_device;
-    text_device.Attach(pTextMask, false, nullptr, false);
-    for (size_t i = 0; i < pPageObj->m_ClipPath.GetTextCount(); ++i) {
-      CPDF_TextObject* textobj = pPageObj->m_ClipPath.GetText(i);
-      if (!textobj)
-        break;
-
-      // TODO(thestig): Should we check the return value here?
-      CPDF_TextRenderer::DrawTextPath(
-          &text_device, textobj->GetCharCodes(), textobj->GetCharPositions(),
-          textobj->m_TextState.GetFont().Get(),
-          textobj->m_TextState.GetFontSize(), textobj->GetTextMatrix(),
-          &new_matrix, textobj->m_GraphState.GetObject(), 0xffffffff, 0,
-          nullptr, CFX_FillRenderOptions());
-    }
-  }
-  CPDF_RenderStatus bitmap_render(m_pContext.Get(), &bitmap_device);
-  bitmap_render.SetOptions(m_Options);
-  bitmap_render.SetStopObject(m_pStopObj.Get());
-  bitmap_render.SetStdCS(true);
-  bitmap_render.SetDropObjects(m_bDropObjects);
-  bitmap_render.SetFormResource(pFormResource);
-  bitmap_render.Initialize(nullptr, nullptr);
-  bitmap_render.ProcessObjectNoClip(pPageObj, new_matrix);
-#if defined(_SKIA_SUPPORT_PATHS_)
-  bitmap_device.Flush(true);
-  bitmap->UnPreMultiply();
-#endif
-  m_bStopped = bitmap_render.m_bStopped;
-  if (pSMaskDict) {
-    CFX_Matrix smask_matrix =
-        *pPageObj->m_GeneralState.GetSMaskMatrix() * mtObj2Device;
-    RetainPtr<CFX_DIBBase> pSMaskSource =
-        LoadSMask(pSMaskDict, &rect, smask_matrix);
-    if (pSMaskSource)
-      bitmap->MultiplyAlpha(pSMaskSource);
-  }
-  if (pTextMask) {
-    bitmap->MultiplyAlpha(pTextMask);
-    pTextMask.Reset();
-  }
-  int32_t blitAlpha = 255;
-  if (group_alpha != 1.0f && transparency.IsGroup()) {
-    blitAlpha = static_cast<int32_t>(group_alpha * 255);
-#if !defined(_SKIA_SUPPORT_)
-    bitmap->MultiplyAlpha(blitAlpha);
-    blitAlpha = 255;
-#endif
-  }
-  transparency = m_Transparency;
-  if (pPageObj->IsForm()) {
-    transparency.SetGroup();
-  }
-  CompositeDIBitmap(bitmap, rect.left, rect.top, 0, blitAlpha, blend_type,
-                    transparency);
-#if defined(_SKIA_SUPPORT_)
-  DebugVerifyDeviceIsPreMultiplied();
-#endif
+//#if defined(_SKIA_SUPPORT_)
+//  DebugVerifyDeviceIsPreMultiplied();
+//#endif
+//  const BlendMode blend_type = pPageObj->m_GeneralState.GetBlendType();
+//  CPDF_Dictionary* pSMaskDict =
+//      ToDictionary(pPageObj->m_GeneralState.GetSoftMask());
+//  if (pSMaskDict) {
+//    if (pPageObj->IsImage() &&
+//        pPageObj->AsImage()->GetImage()->GetDict()->KeyExist("SMask")) {
+//      pSMaskDict = nullptr;
+//    }
+//  }
+//  const CPDF_Dictionary* pFormResource = nullptr;
+//  float group_alpha = 1.0f;
+//  CPDF_Transparency transparency = m_Transparency;
+//  bool bGroupTransparent = false;
+//  const CPDF_FormObject* pFormObj = pPageObj->AsForm();
+//  if (pFormObj) {
+//    group_alpha = pFormObj->m_GeneralState.GetFillAlpha();
+//    transparency = pFormObj->form()->GetTransparency();
+//    bGroupTransparent = transparency.IsIsolated();
+//    pFormResource = pFormObj->form()->GetDict()->GetDictFor("Resources");
+//  }
+//  bool bTextClip =
+//      (pPageObj->m_ClipPath.HasRef() &&
+//       pPageObj->m_ClipPath.GetTextCount() > 0 && !m_bPrint &&
+//       !(m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_SOFT_CLIP));
+//  if (!pSMaskDict && group_alpha == 1.0f && blend_type == BlendMode::kNormal &&
+//      !bTextClip && !bGroupTransparent) {
+//    return false;
+//  }
+//  if (m_bPrint) {
+//    bool bRet = false;
+//    int rendCaps = m_pDevice->GetRenderCaps();
+//    if (!(transparency.IsIsolated() || pSMaskDict || bTextClip) &&
+//        (rendCaps & FXRC_BLEND_MODE)) {
+//      BlendMode oldBlend = m_curBlend;
+//      m_curBlend = blend_type;
+//      bRet = DrawObjWithBlend(pPageObj, mtObj2Device);
+//      m_curBlend = oldBlend;
+//    }
+//    if (!bRet) {
+//      DrawObjWithBackground(pPageObj, mtObj2Device);
+//    }
+//    return true;
+//  }
+//  FX_RECT rect = pPageObj->GetTransformedBBox(mtObj2Device);
+//  rect.Intersect(m_pDevice->GetClipBox());
+//  if (rect.IsEmpty())
+//    return true;
+//
+//  int width = rect.Width();
+//  int height = rect.Height();
+//  CFX_DefaultRenderDevice bitmap_device;
+//  RetainPtr<CFX_DIBitmap> backdrop;
+//  if (!transparency.IsIsolated() &&
+//      (m_pDevice->GetRenderCaps() & FXRC_GET_BITS)) {
+//    backdrop = pdfium::MakeRetain<CFX_DIBitmap>();
+//    if (!m_pDevice->CreateCompatibleBitmap(backdrop, width, height))
+//      return true;
+//    m_pDevice->GetDIBits(backdrop, rect.left, rect.top);
+//  }
+//  if (!bitmap_device.Create(width, height, FXDIB_Format::kArgb, backdrop))
+//    return true;
+//
+//  RetainPtr<CFX_DIBitmap> bitmap = bitmap_device.GetBitmap();
+//  bitmap->Clear(0);
+//
+//  CFX_Matrix new_matrix = mtObj2Device;
+//  new_matrix.Translate(-rect.left, -rect.top);
+//
+//  RetainPtr<CFX_DIBitmap> pTextMask;
+//  if (bTextClip) {
+//    pTextMask = pdfium::MakeRetain<CFX_DIBitmap>();
+//    if (!pTextMask->Create(width, height, FXDIB_Format::k8bppMask))
+//      return true;
+//
+//    pTextMask->Clear(0);
+//    CFX_DefaultRenderDevice text_device;
+//    text_device.Attach(pTextMask, false, nullptr, false);
+//    for (size_t i = 0; i < pPageObj->m_ClipPath.GetTextCount(); ++i) {
+//      CPDF_TextObject* textobj = pPageObj->m_ClipPath.GetText(i);
+//      if (!textobj)
+//        break;
+//
+//      // TODO(thestig): Should we check the return value here?
+//      CPDF_TextRenderer::DrawTextPath(
+//          &text_device, textobj->GetCharCodes(), textobj->GetCharPositions(),
+//          textobj->m_TextState.GetFont().Get(),
+//          textobj->m_TextState.GetFontSize(), textobj->GetTextMatrix(),
+//          &new_matrix, textobj->m_GraphState.GetObject(), 0xffffffff, 0,
+//          nullptr, CFX_FillRenderOptions());
+//    }
+//  }
+//  CPDF_RenderStatus bitmap_render(m_pContext.Get(), &bitmap_device);
+//  bitmap_render.SetOptions(m_Options);
+//  bitmap_render.SetStopObject(m_pStopObj.Get());
+//  bitmap_render.SetStdCS(true);
+//  bitmap_render.SetDropObjects(m_bDropObjects);
+//  bitmap_render.SetFormResource(pFormResource);
+//  bitmap_render.Initialize(nullptr, nullptr);
+//  bitmap_render.ProcessObjectNoClip(pPageObj, new_matrix);
+//#if defined(_SKIA_SUPPORT_PATHS_)
+//  bitmap_device.Flush(true);
+//  bitmap->UnPreMultiply();
+//#endif
+//  m_bStopped = bitmap_render.m_bStopped;
+//  if (pSMaskDict) {
+//    CFX_Matrix smask_matrix =
+//        *pPageObj->m_GeneralState.GetSMaskMatrix() * mtObj2Device;
+//    RetainPtr<CFX_DIBBase> pSMaskSource =
+//        LoadSMask(pSMaskDict, &rect, smask_matrix);
+//    if (pSMaskSource)
+//      bitmap->MultiplyAlpha(pSMaskSource);
+//  }
+//  if (pTextMask) {
+//    bitmap->MultiplyAlpha(pTextMask);
+//    pTextMask.Reset();
+//  }
+//  int32_t blitAlpha = 255;
+//  if (group_alpha != 1.0f && transparency.IsGroup()) {
+//    blitAlpha = static_cast<int32_t>(group_alpha * 255);
+//#if !defined(_SKIA_SUPPORT_)
+//    bitmap->MultiplyAlpha(blitAlpha);
+//    blitAlpha = 255;
+//#endif
+//  }
+//  transparency = m_Transparency;
+//  if (pPageObj->IsForm()) {
+//    transparency.SetGroup();
+//  }
+//  CompositeDIBitmap(bitmap, rect.left, rect.top, 0, blitAlpha, blend_type,
+//                    transparency);
+//#if defined(_SKIA_SUPPORT_)
+//  DebugVerifyDeviceIsPreMultiplied();
+//#endif
   return true;
 }
 
 FX_RECT CPDF_RenderStatus::GetClippedBBox(const FX_RECT& rect) const {
   FX_RECT bbox = rect;
-  bbox.Intersect(m_pDevice->GetClipBox());
+  //bbox.Intersect(m_pDevice->GetClipBox());
   return bbox;
 }
 
@@ -745,35 +748,36 @@ RetainPtr<CFX_DIBitmap> CPDF_RenderStatus::GetBackdrop(
     const CPDF_PageObject* pObj,
     const FX_RECT& bbox,
     bool bBackAlphaRequired) {
-  int width = bbox.Width();
-  int height = bbox.Height();
-  auto pBackdrop = pdfium::MakeRetain<CFX_DIBitmap>();
-  if (bBackAlphaRequired && !m_bDropObjects)
-    pBackdrop->Create(width, height, FXDIB_Format::kArgb);
-  else
-    m_pDevice->CreateCompatibleBitmap(pBackdrop, width, height);
-
-  if (!pBackdrop->GetBuffer())
-    return nullptr;
-
-  bool bNeedDraw;
-  if (pBackdrop->IsAlphaFormat())
-    bNeedDraw = !(m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT);
-  else
-    bNeedDraw = !(m_pDevice->GetRenderCaps() & FXRC_GET_BITS);
-
-  if (!bNeedDraw) {
-    m_pDevice->GetDIBits(pBackdrop, bbox.left, bbox.top);
-    return pBackdrop;
-  }
-  CFX_Matrix FinalMatrix = m_DeviceMatrix;
-  FinalMatrix.Translate(-bbox.left, -bbox.top);
-  pBackdrop->Clear(pBackdrop->IsAlphaFormat() ? 0 : 0xffffffff);
-
-  CFX_DefaultRenderDevice device;
-  device.Attach(pBackdrop, false, nullptr, false);
-  m_pContext->Render(&device, pObj, &m_Options, &FinalMatrix);
-  return pBackdrop;
+  //int width = bbox.Width();
+  //int height = bbox.Height();
+  //auto pBackdrop = pdfium::MakeRetain<CFX_DIBitmap>();
+  //if (bBackAlphaRequired && !m_bDropObjects)
+  //  pBackdrop->Create(width, height, FXDIB_Format::kArgb);
+  //else
+  //  m_pDevice->CreateCompatibleBitmap(pBackdrop, width, height);
+
+  //if (!pBackdrop->GetBuffer())
+  //  return nullptr;
+
+  //bool bNeedDraw;
+  //if (pBackdrop->IsAlphaFormat())
+  //  bNeedDraw = !(m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT);
+  //else
+  //  bNeedDraw = !(m_pDevice->GetRenderCaps() & FXRC_GET_BITS);
+
+  //if (!bNeedDraw) {
+  //  m_pDevice->GetDIBits(pBackdrop, bbox.left, bbox.top);
+  //  return pBackdrop;
+  //}
+  //CFX_Matrix FinalMatrix = m_DeviceMatrix;
+  //FinalMatrix.Translate(-bbox.left, -bbox.top);
+  //pBackdrop->Clear(pBackdrop->IsAlphaFormat() ? 0 : 0xffffffff);
+
+  //CFX_DefaultRenderDevice device;
+  //device.Attach(pBackdrop, false, nullptr, false);
+  //m_pContext->Render(&device, pObj, &m_Options, &FinalMatrix);
+  //return pBackdrop;
+  return nullptr;
 }
 
 std::unique_ptr<CPDF_GraphicStates> CPDF_RenderStatus::CloneObjStates(
@@ -797,284 +801,285 @@ std::unique_ptr<CPDF_GraphicStates> CPDF_RenderStatus::CloneObjStates(
   return pStates;
 }
 
-#if defined(_SKIA_SUPPORT_)
-void CPDF_RenderStatus::DebugVerifyDeviceIsPreMultiplied() const {
-  m_pDevice->DebugVerifyBitmapIsPreMultiplied();
-}
-#endif
+//#if defined(_SKIA_SUPPORT_)
+//void CPDF_RenderStatus::DebugVerifyDeviceIsPreMultiplied() const {
+//  m_pDevice->DebugVerifyBitmapIsPreMultiplied();
+//}
+//#endif
 
 bool CPDF_RenderStatus::ProcessText(CPDF_TextObject* textobj,
                                     const CFX_Matrix& mtObj2Device,
                                     CFX_Path* clipping_path) {
-  if (textobj->GetCharCodes().empty())
-    return true;
-
-  const TextRenderingMode text_render_mode = textobj->m_TextState.GetTextMode();
-  if (text_render_mode == TextRenderingMode::MODE_INVISIBLE)
-    return true;
-
-  RetainPtr<CPDF_Font> pFont = textobj->m_TextState.GetFont();
-  if (pFont->IsType3Font())
-    return ProcessType3Text(textobj, mtObj2Device);
-
-  bool is_fill = false;
-  bool is_stroke = false;
-  bool is_clip = false;
-  if (clipping_path) {
-    is_clip = true;
-  } else {
-    switch (text_render_mode) {
-      case TextRenderingMode::MODE_FILL:
-      case TextRenderingMode::MODE_FILL_CLIP:
-        is_fill = true;
-        break;
-      case TextRenderingMode::MODE_STROKE:
-      case TextRenderingMode::MODE_STROKE_CLIP:
-        if (pFont->HasFace())
-          is_stroke = true;
-        else
-          is_fill = true;
-        break;
-      case TextRenderingMode::MODE_FILL_STROKE:
-      case TextRenderingMode::MODE_FILL_STROKE_CLIP:
-        is_fill = true;
-        if (pFont->HasFace())
-          is_stroke = true;
-        break;
-      case TextRenderingMode::MODE_INVISIBLE:
-        // Already handled above, but the compiler is not smart enough to
-        // realize it.
-        NOTREACHED();
-        return true;
-      case TextRenderingMode::MODE_CLIP:
-        return true;
-      case TextRenderingMode::MODE_UNKNOWN:
-        NOTREACHED();
-        return false;
-    }
-  }
-  FX_ARGB stroke_argb = 0;
-  FX_ARGB fill_argb = 0;
-  bool bPattern = false;
-  if (is_stroke) {
-    if (textobj->m_ColorState.GetStrokeColor()->IsPattern()) {
-      bPattern = true;
-    } else {
-      stroke_argb = GetStrokeArgb(textobj);
-    }
-  }
-  if (is_fill) {
-    if (textobj->m_ColorState.GetFillColor()->IsPattern()) {
-      bPattern = true;
-    } else {
-      fill_argb = GetFillArgb(textobj);
-    }
-  }
-  CFX_Matrix text_matrix = textobj->GetTextMatrix();
-  if (!IsAvailableMatrix(text_matrix))
-    return true;
-
-  float font_size = textobj->m_TextState.GetFontSize();
-  if (bPattern) {
-    DrawTextPathWithPattern(textobj, mtObj2Device, pFont.Get(), font_size,
-                            text_matrix, is_fill, is_stroke);
-    return true;
-  }
-  if (is_clip || is_stroke) {
-    const CFX_Matrix* pDeviceMatrix = &mtObj2Device;
-    CFX_Matrix device_matrix;
-    if (is_stroke) {
-      pdfium::span<const float> pCTM = textobj->m_TextState.GetCTM();
-      if (pCTM[0] != 1.0f || pCTM[3] != 1.0f) {
-        CFX_Matrix ctm(pCTM[0], pCTM[1], pCTM[2], pCTM[3], 0, 0);
-        text_matrix *= ctm.GetInverse();
-        device_matrix = ctm * mtObj2Device;
-        pDeviceMatrix = &device_matrix;
-      }
-    }
-    return CPDF_TextRenderer::DrawTextPath(
-        m_pDevice, textobj->GetCharCodes(), textobj->GetCharPositions(),
-        pFont.Get(), font_size, text_matrix, pDeviceMatrix,
-        textobj->m_GraphState.GetObject(), fill_argb, stroke_argb,
-        clipping_path,
-        GetFillOptionsForDrawTextPath(m_Options.GetOptions(), textobj,
-                                      is_stroke, is_fill));
-  }
-  text_matrix.Concat(mtObj2Device);
-  return CPDF_TextRenderer::DrawNormalText(
-      m_pDevice, textobj->GetCharCodes(), textobj->GetCharPositions(),
-      pFont.Get(), font_size, text_matrix, fill_argb, m_Options);
+  return true;
+  //if (textobj->GetCharCodes().empty())
+  //  return true;
+
+  //const TextRenderingMode text_render_mode = textobj->m_TextState.GetTextMode();
+  //if (text_render_mode == TextRenderingMode::MODE_INVISIBLE)
+  //  return true;
+
+  //RetainPtr<CPDF_Font> pFont = textobj->m_TextState.GetFont();
+  //if (pFont->IsType3Font())
+  //  return ProcessType3Text(textobj, mtObj2Device);
+
+  //bool is_fill = false;
+  //bool is_stroke = false;
+  //bool is_clip = false;
+  //if (clipping_path) {
+  //  is_clip = true;
+  //} else {
+  //  switch (text_render_mode) {
+  //    case TextRenderingMode::MODE_FILL:
+  //    case TextRenderingMode::MODE_FILL_CLIP:
+  //      is_fill = true;
+  //      break;
+  //    case TextRenderingMode::MODE_STROKE:
+  //    case TextRenderingMode::MODE_STROKE_CLIP:
+  //      if (pFont->HasFace())
+  //        is_stroke = true;
+  //      else
+  //        is_fill = true;
+  //      break;
+  //    case TextRenderingMode::MODE_FILL_STROKE:
+  //    case TextRenderingMode::MODE_FILL_STROKE_CLIP:
+  //      is_fill = true;
+  //      if (pFont->HasFace())
+  //        is_stroke = true;
+  //      break;
+  //    case TextRenderingMode::MODE_INVISIBLE:
+  //      // Already handled above, but the compiler is not smart enough to
+  //      // realize it.
+  //      NOTREACHED();
+  //      return true;
+  //    case TextRenderingMode::MODE_CLIP:
+  //      return true;
+  //    case TextRenderingMode::MODE_UNKNOWN:
+  //      NOTREACHED();
+  //      return false;
+  //  }
+  //}
+  //FX_ARGB stroke_argb = 0;
+  //FX_ARGB fill_argb = 0;
+  //bool bPattern = false;
+  //if (is_stroke) {
+  //  if (textobj->m_ColorState.GetStrokeColor()->IsPattern()) {
+  //    bPattern = true;
+  //  } else {
+  //    stroke_argb = GetStrokeArgb(textobj);
+  //  }
+  //}
+  //if (is_fill) {
+  //  if (textobj->m_ColorState.GetFillColor()->IsPattern()) {
+  //    bPattern = true;
+  //  } else {
+  //    fill_argb = GetFillArgb(textobj);
+  //  }
+  //}
+  //CFX_Matrix text_matrix = textobj->GetTextMatrix();
+  //if (!IsAvailableMatrix(text_matrix))
+  //  return true;
+
+  //float font_size = textobj->m_TextState.GetFontSize();
+  //if (bPattern) {
+  //  DrawTextPathWithPattern(textobj, mtObj2Device, pFont.Get(), font_size,
+  //                          text_matrix, is_fill, is_stroke);
+  //  return true;
+  //}
+  //if (is_clip || is_stroke) {
+  //  const CFX_Matrix* pDeviceMatrix = &mtObj2Device;
+  //  CFX_Matrix device_matrix;
+  //  if (is_stroke) {
+  //    pdfium::span<const float> pCTM = textobj->m_TextState.GetCTM();
+  //    if (pCTM[0] != 1.0f || pCTM[3] != 1.0f) {
+  //      CFX_Matrix ctm(pCTM[0], pCTM[1], pCTM[2], pCTM[3], 0, 0);
+  //      text_matrix *= ctm.GetInverse();
+  //      device_matrix = ctm * mtObj2Device;
+  //      pDeviceMatrix = &device_matrix;
+  //    }
+  //  }
+  //  return CPDF_TextRenderer::DrawTextPath(
+  //      m_pDevice, textobj->GetCharCodes(), textobj->GetCharPositions(),
+  //      pFont.Get(), font_size, text_matrix, pDeviceMatrix,
+  //      textobj->m_GraphState.GetObject(), fill_argb, stroke_argb,
+  //      clipping_path,
+  //      GetFillOptionsForDrawTextPath(m_Options.GetOptions(), textobj,
+  //                                    is_stroke, is_fill));
+  //}
+  //text_matrix.Concat(mtObj2Device);
+  //return CPDF_TextRenderer::DrawNormalText(
+  //    m_pDevice, textobj->GetCharCodes(), textobj->GetCharPositions(),
+  //    pFont.Get(), font_size, text_matrix, fill_argb, m_Options);
 }
 
 // TODO(npm): Font fallback for type 3 fonts? (Completely separate code!!)
 bool CPDF_RenderStatus::ProcessType3Text(CPDF_TextObject* textobj,
                                          const CFX_Matrix& mtObj2Device) {
-  CPDF_Type3Font* pType3Font = textobj->m_TextState.GetFont()->AsType3Font();
-  if (pdfium::Contains(m_Type3FontCache, pType3Font))
-    return true;
-
-  FX_ARGB fill_argb = GetFillArgbForType3(textobj);
-  int fill_alpha = FXARGB_A(fill_argb);
-  if (m_bPrint && fill_alpha < 255)
-    return false;
-
-  CFX_Matrix text_matrix = textobj->GetTextMatrix();
-  CFX_Matrix char_matrix = pType3Font->GetFontMatrix();
-  float font_size = textobj->m_TextState.GetFontSize();
-  char_matrix.Scale(font_size, font_size);
-
-  // Must come before |glyphs|, because |glyphs| points into |refTypeCache|.
-  std::set<RetainPtr<CPDF_Type3Cache>> refTypeCache;
-  std::vector<TextGlyphPos> glyphs;
-  if (!m_bPrint)
-    glyphs.resize(textobj->GetCharCodes().size());
-
-  for (size_t iChar = 0; iChar < textobj->GetCharCodes().size(); ++iChar) {
-    uint32_t charcode = textobj->GetCharCodes()[iChar];
-    if (charcode == static_cast<uint32_t>(-1))
-      continue;
-
-    CPDF_Type3Char* pType3Char = pType3Font->LoadChar(charcode);
-    if (!pType3Char)
-      continue;
-
-    CFX_Matrix matrix = char_matrix;
-    matrix.e += iChar > 0 ? textobj->GetCharPositions()[iChar - 1] : 0;
-    matrix.Concat(text_matrix);
-    matrix.Concat(mtObj2Device);
-    if (!pType3Char->LoadBitmapFromSoleImageOfForm()) {
-      if (!glyphs.empty()) {
-        for (size_t i = 0; i < iChar; ++i) {
-          const TextGlyphPos& glyph = glyphs[i];
-          if (!glyph.m_pGlyph)
-            continue;
-
-          absl::optional<CFX_Point> point = glyph.GetOrigin({0, 0});
-          if (!point.has_value())
-            continue;
-
-          m_pDevice->SetBitMask(glyph.m_pGlyph->GetBitmap(), point->x, point->y,
-                                fill_argb);
-        }
-        glyphs.clear();
-      }
-
-      std::unique_ptr<CPDF_GraphicStates> pStates =
-          CloneObjStates(textobj, false);
-      CPDF_RenderOptions options = m_Options;
-      options.GetOptions().bForceHalftone = true;
-      options.GetOptions().bRectAA = true;
-
-      const auto* pForm = static_cast<const CPDF_Form*>(pType3Char->form());
-      const CPDF_Dictionary* pFormResource =
-          pForm->GetDict()->GetDictFor("Resources");
-
-      if (fill_alpha == 255) {
-        CPDF_RenderStatus status(m_pContext.Get(), m_pDevice);
-        status.SetOptions(options);
-        status.SetTransparency(pForm->GetTransparency());
-        status.SetType3Char(pType3Char);
-        status.SetFillColor(fill_argb);
-        status.SetDropObjects(m_bDropObjects);
-        status.SetFormResource(pFormResource);
-        status.Initialize(this, pStates.get());
-        status.m_Type3FontCache = m_Type3FontCache;
-        status.m_Type3FontCache.emplace_back(pType3Font);
-
-        CFX_RenderDevice::StateRestorer restorer(m_pDevice);
-        status.RenderObjectList(pForm, matrix);
-      } else {
-        FX_RECT rect =
-            matrix.TransformRect(pForm->CalcBoundingBox()).GetOuterRect();
-        if (!rect.Valid())
-          continue;
-
-        CFX_DefaultRenderDevice bitmap_device;
-        if (!bitmap_device.Create(rect.Width(), rect.Height(),
-                                  FXDIB_Format::kArgb, nullptr)) {
-          return true;
-        }
-        bitmap_device.GetBitmap()->Clear(0);
-        CPDF_RenderStatus status(m_pContext.Get(), &bitmap_device);
-        status.SetOptions(options);
-        status.SetTransparency(pForm->GetTransparency());
-        status.SetType3Char(pType3Char);
-        status.SetFillColor(fill_argb);
-        status.SetDropObjects(m_bDropObjects);
-        status.SetFormResource(pFormResource);
-        status.Initialize(this, pStates.get());
-        status.m_Type3FontCache = m_Type3FontCache;
-        status.m_Type3FontCache.emplace_back(pType3Font);
-        matrix.Translate(-rect.left, -rect.top);
-        status.RenderObjectList(pForm, matrix);
-        m_pDevice->SetDIBits(bitmap_device.GetBitmap(), rect.left, rect.top);
-      }
-    } else if (pType3Char->GetBitmap()) {
-      if (m_bPrint) {
-        CFX_Matrix image_matrix = pType3Char->matrix() * matrix;
-        CPDF_ImageRenderer renderer;
-        if (renderer.Start(this, pType3Char->GetBitmap(), fill_argb,
-                           image_matrix, FXDIB_ResampleOptions(), false)) {
-          renderer.Continue(nullptr);
-        }
-        if (!renderer.GetResult())
-          return false;
-      } else {
-        CPDF_Document* pDoc = pType3Font->GetDocument();
-        RetainPtr<CPDF_Type3Cache> pCache =
-            CPDF_DocRenderData::FromDocument(pDoc)->GetCachedType3(pType3Font);
-
-        const CFX_GlyphBitmap* pBitmap = pCache->LoadGlyph(charcode, matrix);
-        if (!pBitmap)
-          continue;
-
-        refTypeCache.insert(std::move(pCache));
-
-        CFX_Point origin(FXSYS_roundf(matrix.e), FXSYS_roundf(matrix.f));
-        if (glyphs.empty()) {
-          FX_SAFE_INT32 left = origin.x;
-          left += pBitmap->left();
-          if (!left.IsValid())
-            continue;
-
-          FX_SAFE_INT32 top = origin.y;
-          top -= pBitmap->top();
-          if (!top.IsValid())
-            continue;
-
-          m_pDevice->SetBitMask(pBitmap->GetBitmap(), left.ValueOrDie(),
-                                top.ValueOrDie(), fill_argb);
-        } else {
-          glyphs[iChar].m_pGlyph = pBitmap;
-          glyphs[iChar].m_Origin = origin;
-        }
-      }
-    }
-  }
-
-  if (glyphs.empty())
-    return true;
-
-  FX_RECT rect = GetGlyphsBBox(glyphs, 0);
-  auto pBitmap = pdfium::MakeRetain<CFX_DIBitmap>();
-  if (!pBitmap->Create(rect.Width(), rect.Height(), FXDIB_Format::k8bppMask))
-    return true;
-
-  pBitmap->Clear(0);
-  for (const TextGlyphPos& glyph : glyphs) {
-    if (!glyph.m_pGlyph || !glyph.m_pGlyph->GetBitmap()->IsMaskFormat())
-      continue;
-
-    absl::optional<CFX_Point> point = glyph.GetOrigin({rect.left, rect.top});
-    if (!point.has_value())
-      continue;
-
-    pBitmap->CompositeMask(
-        point->x, point->y, glyph.m_pGlyph->GetBitmap()->GetWidth(),
-        glyph.m_pGlyph->GetBitmap()->GetHeight(), glyph.m_pGlyph->GetBitmap(),
-        fill_argb, 0, 0, BlendMode::kNormal, nullptr, false);
-  }
-  m_pDevice->SetBitMask(pBitmap, rect.left, rect.top, fill_argb);
+  //CPDF_Type3Font* pType3Font = textobj->m_TextState.GetFont()->AsType3Font();
+  //if (pdfium::Contains(m_Type3FontCache, pType3Font))
+  //  return true;
+
+  //FX_ARGB fill_argb = GetFillArgbForType3(textobj);
+  //int fill_alpha = FXARGB_A(fill_argb);
+  //if (m_bPrint && fill_alpha < 255)
+  //  return false;
+
+  //CFX_Matrix text_matrix = textobj->GetTextMatrix();
+  //CFX_Matrix char_matrix = pType3Font->GetFontMatrix();
+  //float font_size = textobj->m_TextState.GetFontSize();
+  //char_matrix.Scale(font_size, font_size);
+
+  //// Must come before |glyphs|, because |glyphs| points into |refTypeCache|.
+  //std::set<RetainPtr<CPDF_Type3Cache>> refTypeCache;
+  //std::vector<TextGlyphPos> glyphs;
+  //if (!m_bPrint)
+  //  glyphs.resize(textobj->GetCharCodes().size());
+
+  //for (size_t iChar = 0; iChar < textobj->GetCharCodes().size(); ++iChar) {
+  //  uint32_t charcode = textobj->GetCharCodes()[iChar];
+  //  if (charcode == static_cast<uint32_t>(-1))
+  //    continue;
+
+  //  CPDF_Type3Char* pType3Char = pType3Font->LoadChar(charcode);
+  //  if (!pType3Char)
+  //    continue;
+
+  //  CFX_Matrix matrix = char_matrix;
+  //  matrix.e += iChar > 0 ? textobj->GetCharPositions()[iChar - 1] : 0;
+  //  matrix.Concat(text_matrix);
+  //  matrix.Concat(mtObj2Device);
+  //  if (!pType3Char->LoadBitmapFromSoleImageOfForm()) {
+  //    if (!glyphs.empty()) {
+  //      for (size_t i = 0; i < iChar; ++i) {
+  //        const TextGlyphPos& glyph = glyphs[i];
+  //        if (!glyph.m_pGlyph)
+  //          continue;
+
+  //        absl::optional<CFX_Point> point = glyph.GetOrigin({0, 0});
+  //        if (!point.has_value())
+  //          continue;
+
+  //        m_pDevice->SetBitMask(glyph.m_pGlyph->GetBitmap(), point->x, point->y,
+  //                              fill_argb);
+  //      }
+  //      glyphs.clear();
+  //    }
+
+  //    std::unique_ptr<CPDF_GraphicStates> pStates =
+  //        CloneObjStates(textobj, false);
+  //    CPDF_RenderOptions options = m_Options;
+  //    options.GetOptions().bForceHalftone = true;
+  //    options.GetOptions().bRectAA = true;
+
+  //    const auto* pForm = static_cast<const CPDF_Form*>(pType3Char->form());
+  //    const CPDF_Dictionary* pFormResource =
+  //        pForm->GetDict()->GetDictFor("Resources");
+
+  //    if (fill_alpha == 255) {
+  //      CPDF_RenderStatus status(m_pContext.Get(), m_pDevice);
+  //      status.SetOptions(options);
+  //      status.SetTransparency(pForm->GetTransparency());
+  //      status.SetType3Char(pType3Char);
+  //      status.SetFillColor(fill_argb);
+  //      status.SetDropObjects(m_bDropObjects);
+  //      status.SetFormResource(pFormResource);
+  //      status.Initialize(this, pStates.get());
+  //      status.m_Type3FontCache = m_Type3FontCache;
+  //      status.m_Type3FontCache.emplace_back(pType3Font);
+
+  //      CFX_RenderDevice::StateRestorer restorer(m_pDevice);
+  //      status.RenderObjectList(pForm, matrix);
+  //    } else {
+  //      FX_RECT rect =
+  //          matrix.TransformRect(pForm->CalcBoundingBox()).GetOuterRect();
+  //      if (!rect.Valid())
+  //        continue;
+
+  //      CFX_DefaultRenderDevice bitmap_device;
+  //      if (!bitmap_device.Create(rect.Width(), rect.Height(),
+  //                                FXDIB_Format::kArgb, nullptr)) {
+  //        return true;
+  //      }
+  //      bitmap_device.GetBitmap()->Clear(0);
+  //      CPDF_RenderStatus status(m_pContext.Get(), &bitmap_device);
+  //      status.SetOptions(options);
+  //      status.SetTransparency(pForm->GetTransparency());
+  //      status.SetType3Char(pType3Char);
+  //      status.SetFillColor(fill_argb);
+  //      status.SetDropObjects(m_bDropObjects);
+  //      status.SetFormResource(pFormResource);
+  //      status.Initialize(this, pStates.get());
+  //      status.m_Type3FontCache = m_Type3FontCache;
+  //      status.m_Type3FontCache.emplace_back(pType3Font);
+  //      matrix.Translate(-rect.left, -rect.top);
+  //      status.RenderObjectList(pForm, matrix);
+  //      m_pDevice->SetDIBits(bitmap_device.GetBitmap(), rect.left, rect.top);
+  //    }
+  //  } else if (pType3Char->GetBitmap()) {
+  //    if (m_bPrint) {
+  //      CFX_Matrix image_matrix = pType3Char->matrix() * matrix;
+  //      CPDF_ImageRenderer renderer;
+  //      if (renderer.Start(this, pType3Char->GetBitmap(), fill_argb,
+  //                         image_matrix, FXDIB_ResampleOptions(), false)) {
+  //        renderer.Continue(nullptr);
+  //      }
+  //      if (!renderer.GetResult())
+  //        return false;
+  //    } else {
+  //      CPDF_Document* pDoc = pType3Font->GetDocument();
+  //      RetainPtr<CPDF_Type3Cache> pCache =
+  //          CPDF_DocRenderData::FromDocument(pDoc)->GetCachedType3(pType3Font);
+
+  //      const CFX_GlyphBitmap* pBitmap = pCache->LoadGlyph(charcode, matrix);
+  //      if (!pBitmap)
+  //        continue;
+
+  //      refTypeCache.insert(std::move(pCache));
+
+  //      CFX_Point origin(FXSYS_roundf(matrix.e), FXSYS_roundf(matrix.f));
+  //      if (glyphs.empty()) {
+  //        FX_SAFE_INT32 left = origin.x;
+  //        left += pBitmap->left();
+  //        if (!left.IsValid())
+  //          continue;
+
+  //        FX_SAFE_INT32 top = origin.y;
+  //        top -= pBitmap->top();
+  //        if (!top.IsValid())
+  //          continue;
+
+  //        m_pDevice->SetBitMask(pBitmap->GetBitmap(), left.ValueOrDie(),
+  //                              top.ValueOrDie(), fill_argb);
+  //      } else {
+  //        glyphs[iChar].m_pGlyph = pBitmap;
+  //        glyphs[iChar].m_Origin = origin;
+  //      }
+  //    }
+  //  }
+  //}
+
+  //if (glyphs.empty())
+  //  return true;
+
+  //FX_RECT rect = GetGlyphsBBox(glyphs, 0);
+  //auto pBitmap = pdfium::MakeRetain<CFX_DIBitmap>();
+  //if (!pBitmap->Create(rect.Width(), rect.Height(), FXDIB_Format::k8bppMask))
+  //  return true;
+
+  //pBitmap->Clear(0);
+  //for (const TextGlyphPos& glyph : glyphs) {
+  //  if (!glyph.m_pGlyph || !glyph.m_pGlyph->GetBitmap()->IsMaskFormat())
+  //    continue;
+
+  //  absl::optional<CFX_Point> point = glyph.GetOrigin({rect.left, rect.top});
+  //  if (!point.has_value())
+  //    continue;
+
+  //  pBitmap->CompositeMask(
+  //      point->x, point->y, glyph.m_pGlyph->GetBitmap()->GetWidth(),
+  //      glyph.m_pGlyph->GetBitmap()->GetHeight(), glyph.m_pGlyph->GetBitmap(),
+  //      fill_argb, 0, 0, BlendMode::kNormal, nullptr, false);
+  //}
+  //m_pDevice->SetBitMask(pBitmap, rect.left, rect.top, fill_argb);
   return true;
 }
 
@@ -1140,68 +1145,68 @@ void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern,
                                            const CPDF_PageObject* pPageObj,
                                            const CFX_Matrix& mtObj2Device,
                                            bool stroke) {
-  if (!pattern->Load())
-    return;
-
-  CFX_RenderDevice::StateRestorer restorer(m_pDevice);
-  if (!ClipPattern(pPageObj, mtObj2Device, stroke))
-    return;
-
-  FX_RECT rect = GetObjectClippedRect(pPageObj, mtObj2Device);
-  if (rect.IsEmpty())
-    return;
-
-  CFX_Matrix matrix = pattern->pattern_to_form() * mtObj2Device;
-  int alpha =
-      FXSYS_roundf(255 * (stroke ? pPageObj->m_GeneralState.GetStrokeAlpha()
-                                 : pPageObj->m_GeneralState.GetFillAlpha()));
-  CPDF_RenderShading::Draw(m_pDevice, m_pContext.Get(), m_pCurObj.Get(),
-                           pattern, matrix, rect, alpha, m_Options);
+  //if (!pattern->Load())
+  //  return;
+
+  //CFX_RenderDevice::StateRestorer restorer(m_pDevice);
+  //if (!ClipPattern(pPageObj, mtObj2Device, stroke))
+  //  return;
+
+  //FX_RECT rect = GetObjectClippedRect(pPageObj, mtObj2Device);
+  //if (rect.IsEmpty())
+  //  return;
+
+  //CFX_Matrix matrix = pattern->pattern_to_form() * mtObj2Device;
+  //int alpha =
+  //    FXSYS_roundf(255 * (stroke ? pPageObj->m_GeneralState.GetStrokeAlpha()
+  //                               : pPageObj->m_GeneralState.GetFillAlpha()));
+  //CPDF_RenderShading::Draw(m_pDevice, m_pContext.Get(), m_pCurObj.Get(),
+  //                         pattern, matrix, rect, alpha, m_Options);
 }
 
 void CPDF_RenderStatus::ProcessShading(const CPDF_ShadingObject* pShadingObj,
                                        const CFX_Matrix& mtObj2Device) {
-  FX_RECT rect = pShadingObj->GetTransformedBBox(mtObj2Device);
-  FX_RECT clip_box = m_pDevice->GetClipBox();
-  rect.Intersect(clip_box);
-  if (rect.IsEmpty())
-    return;
-
-  CFX_Matrix matrix = pShadingObj->matrix() * mtObj2Device;
-  CPDF_RenderShading::Draw(
-      m_pDevice, m_pContext.Get(), m_pCurObj.Get(), pShadingObj->pattern(),
-      matrix, rect,
-      FXSYS_roundf(255 * pShadingObj->m_GeneralState.GetFillAlpha()),
-      m_Options);
+  //FX_RECT rect = pShadingObj->GetTransformedBBox(mtObj2Device);
+  //FX_RECT clip_box = m_pDevice->GetClipBox();
+  //rect.Intersect(clip_box);
+  //if (rect.IsEmpty())
+  //  return;
+
+  //CFX_Matrix matrix = pShadingObj->matrix() * mtObj2Device;
+  //CPDF_RenderShading::Draw(
+  //    m_pDevice, m_pContext.Get(), m_pCurObj.Get(), pShadingObj->pattern(),
+  //    matrix, rect,
+  //    FXSYS_roundf(255 * pShadingObj->m_GeneralState.GetFillAlpha()),
+  //    m_Options);
 }
 
 void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
                                           CPDF_PageObject* pPageObj,
                                           const CFX_Matrix& mtObj2Device,
                                           bool stroke) {
-  const std::unique_ptr<CPDF_Form> pPatternForm = pPattern->Load(pPageObj);
-  if (!pPatternForm)
-    return;
-
-  CFX_RenderDevice::StateRestorer restorer(m_pDevice);
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
-  ScopedSkiaDeviceFlush scoped_skia_device_flush(m_pDevice);
-#endif
-  if (!ClipPattern(pPageObj, mtObj2Device, stroke))
-    return;
-
-  FX_RECT clip_box = m_pDevice->GetClipBox();
-  if (clip_box.IsEmpty())
-    return;
-
-  RetainPtr<CFX_DIBitmap> pScreen =
-      CPDF_RenderTiling::Draw(this, pPageObj, pPattern, pPatternForm.get(),
-                              mtObj2Device, clip_box, stroke);
-  if (!pScreen)
-    return;
-
-  CompositeDIBitmap(pScreen, clip_box.left, clip_box.top, 0, 255,
-                    BlendMode::kNormal, CPDF_Transparency());
+//  const std::unique_ptr<CPDF_Form> pPatternForm = pPattern->Load(pPageObj);
+//  if (!pPatternForm)
+//    return;
+//
+//  CFX_RenderDevice::StateRestorer restorer(m_pDevice);
+//#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+//  ScopedSkiaDeviceFlush scoped_skia_device_flush(m_pDevice);
+//#endif
+//  if (!ClipPattern(pPageObj, mtObj2Device, stroke))
+//    return;
+//
+//  FX_RECT clip_box = m_pDevice->GetClipBox();
+//  if (clip_box.IsEmpty())
+//    return;
+//
+//  RetainPtr<CFX_DIBitmap> pScreen =
+//      CPDF_RenderTiling::Draw(this, pPageObj, pPattern, pPatternForm.get(),
+//                              mtObj2Device, clip_box, stroke);
+//  if (!pScreen)
+//    return;
+//
+//  CompositeDIBitmap(pScreen, clip_box.left, clip_box.top, 0, 255,
+//                    BlendMode::kNormal, CPDF_Transparency());
 }
 
 void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* path_obj,
@@ -1258,224 +1263,225 @@ void CPDF_RenderStatus::CompositeDIBitmap(
     int bitmap_alpha,
     BlendMode blend_mode,
     const CPDF_Transparency& transparency) {
-  if (!pDIBitmap)
-    return;
-
-  if (blend_mode == BlendMode::kNormal) {
-    if (!pDIBitmap->IsMaskFormat()) {
-      if (bitmap_alpha < 255) {
-#if defined(_SKIA_SUPPORT_)
-        std::unique_ptr<CFX_ImageRenderer> dummy;
-        CFX_Matrix m = CFX_RenderDevice::GetFlipMatrix(
-            pDIBitmap->GetWidth(), pDIBitmap->GetHeight(), left, top);
-        m_pDevice->StartDIBits(pDIBitmap, bitmap_alpha, 0, m,
-                               FXDIB_ResampleOptions(), &dummy);
-        return;
-#else
-        pDIBitmap->MultiplyAlpha(bitmap_alpha);
-#endif
-      }
-#if defined(_SKIA_SUPPORT_)
-      CFX_SkiaDeviceDriver::PreMultiply(pDIBitmap);
-#endif
-      if (m_pDevice->SetDIBits(pDIBitmap, left, top)) {
-        return;
-      }
-    } else {
-      uint32_t fill_argb = m_Options.TranslateColor(mask_argb);
-      if (bitmap_alpha < 255) {
-        uint8_t* fill_argb8 = reinterpret_cast<uint8_t*>(&fill_argb);
-        fill_argb8[3] *= bitmap_alpha / 255;
-      }
-      if (m_pDevice->SetBitMask(pDIBitmap, left, top, fill_argb)) {
-        return;
-      }
-    }
-  }
-  bool bIsolated = transparency.IsIsolated();
-  bool bBackAlphaRequired =
-      blend_mode != BlendMode::kNormal && bIsolated && !m_bDropObjects;
-  bool bGetBackGround =
-      ((m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT)) ||
-      (!(m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT) &&
-       (m_pDevice->GetRenderCaps() & FXRC_GET_BITS) && !bBackAlphaRequired);
-  if (bGetBackGround) {
-    if (bIsolated || !transparency.IsGroup()) {
-      if (!pDIBitmap->IsMaskFormat())
-        m_pDevice->SetDIBitsWithBlend(pDIBitmap, left, top, blend_mode);
-      return;
-    }
-
-    FX_RECT rect(left, top, left + pDIBitmap->GetWidth(),
-                 top + pDIBitmap->GetHeight());
-    rect.Intersect(m_pDevice->GetClipBox());
-    RetainPtr<CFX_DIBitmap> pClone;
-    if (m_pDevice->GetBackDrop() && m_pDevice->GetBitmap()) {
-      pClone = m_pDevice->GetBackDrop()->ClipTo(rect);
-      if (!pClone)
-        return;
-
-      RetainPtr<CFX_DIBitmap> pForeBitmap = m_pDevice->GetBitmap();
-      pClone->CompositeBitmap(0, 0, pClone->GetWidth(), pClone->GetHeight(),
-                              pForeBitmap, rect.left, rect.top,
-                              BlendMode::kNormal, nullptr, false);
-      left = std::min(left, 0);
-      top = std::min(top, 0);
-      if (pDIBitmap->IsMaskFormat()) {
-        pClone->CompositeMask(0, 0, pClone->GetWidth(), pClone->GetHeight(),
-                              pDIBitmap, mask_argb, left, top, blend_mode,
-                              nullptr, false);
-      } else {
-        pClone->CompositeBitmap(0, 0, pClone->GetWidth(), pClone->GetHeight(),
-                                pDIBitmap, left, top, blend_mode, nullptr,
-                                false);
-      }
-    } else {
-      pClone = pDIBitmap;
-    }
-    if (m_pDevice->GetBackDrop()) {
-      m_pDevice->SetDIBits(pClone, rect.left, rect.top);
-    } else {
-      if (!pDIBitmap->IsMaskFormat()) {
-        m_pDevice->SetDIBitsWithBlend(pDIBitmap, rect.left, rect.top,
-                                      blend_mode);
-      }
-    }
-    return;
-  }
-  FX_RECT bbox = GetClippedBBox(FX_RECT(left, top, left + pDIBitmap->GetWidth(),
-                                        top + pDIBitmap->GetHeight()));
-  RetainPtr<CFX_DIBitmap> pBackdrop = GetBackdrop(
-      m_pCurObj.Get(), bbox, blend_mode != BlendMode::kNormal && bIsolated);
-  if (!pBackdrop)
-    return;
-
-  if (pDIBitmap->IsMaskFormat()) {
-    pBackdrop->CompositeMask(left - bbox.left, top - bbox.top,
-                             pDIBitmap->GetWidth(), pDIBitmap->GetHeight(),
-                             pDIBitmap, mask_argb, 0, 0, blend_mode, nullptr,
-                             false);
-  } else {
-    pBackdrop->CompositeBitmap(left - bbox.left, top - bbox.top,
-                               pDIBitmap->GetWidth(), pDIBitmap->GetHeight(),
-                               pDIBitmap, 0, 0, blend_mode, nullptr, false);
-  }
-
-  auto pBackdrop1 = pdfium::MakeRetain<CFX_DIBitmap>();
-  pBackdrop1->Create(pBackdrop->GetWidth(), pBackdrop->GetHeight(),
-                     FXDIB_Format::kRgb32);
-  pBackdrop1->Clear((uint32_t)-1);
-  pBackdrop1->CompositeBitmap(0, 0, pBackdrop->GetWidth(),
-                              pBackdrop->GetHeight(), pBackdrop, 0, 0,
-                              BlendMode::kNormal, nullptr, false);
-  pBackdrop = std::move(pBackdrop1);
-  m_pDevice->SetDIBits(pBackdrop, bbox.left, bbox.top);
+//  if (!pDIBitmap)
+//    return;
+//
+//  if (blend_mode == BlendMode::kNormal) {
+//    if (!pDIBitmap->IsMaskFormat()) {
+//      if (bitmap_alpha < 255) {
+//#if defined(_SKIA_SUPPORT_)
+//        std::unique_ptr<CFX_ImageRenderer> dummy;
+//        CFX_Matrix m = CFX_RenderDevice::GetFlipMatrix(
+//            pDIBitmap->GetWidth(), pDIBitmap->GetHeight(), left, top);
+//        m_pDevice->StartDIBits(pDIBitmap, bitmap_alpha, 0, m,
+//                               FXDIB_ResampleOptions(), &dummy);
+//        return;
+//#else
+//        pDIBitmap->MultiplyAlpha(bitmap_alpha);
+//#endif
+//      }
+//#if defined(_SKIA_SUPPORT_)
+//      CFX_SkiaDeviceDriver::PreMultiply(pDIBitmap);
+//#endif
+//      if (m_pDevice->SetDIBits(pDIBitmap, left, top)) {
+//        return;
+//      }
+//    } else {
+//      uint32_t fill_argb = m_Options.TranslateColor(mask_argb);
+//      if (bitmap_alpha < 255) {
+//        uint8_t* fill_argb8 = reinterpret_cast<uint8_t*>(&fill_argb);
+//        fill_argb8[3] *= bitmap_alpha / 255;
+//      }
+//      if (m_pDevice->SetBitMask(pDIBitmap, left, top, fill_argb)) {
+//        return;
+//      }
+//    }
+//  }
+//  bool bIsolated = transparency.IsIsolated();
+//  bool bBackAlphaRequired =
+//      blend_mode != BlendMode::kNormal && bIsolated && !m_bDropObjects;
+//  bool bGetBackGround =
+//      ((m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT)) ||
+//      (!(m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT) &&
+//       (m_pDevice->GetRenderCaps() & FXRC_GET_BITS) && !bBackAlphaRequired);
+//  if (bGetBackGround) {
+//    if (bIsolated || !transparency.IsGroup()) {
+//      if (!pDIBitmap->IsMaskFormat())
+//        m_pDevice->SetDIBitsWithBlend(pDIBitmap, left, top, blend_mode);
+//      return;
+//    }
+//
+//    FX_RECT rect(left, top, left + pDIBitmap->GetWidth(),
+//                 top + pDIBitmap->GetHeight());
+//    rect.Intersect(m_pDevice->GetClipBox());
+//    RetainPtr<CFX_DIBitmap> pClone;
+//    if (m_pDevice->GetBackDrop() && m_pDevice->GetBitmap()) {
+//      pClone = m_pDevice->GetBackDrop()->ClipTo(rect);
+//      if (!pClone)
+//        return;
+//
+//      RetainPtr<CFX_DIBitmap> pForeBitmap = m_pDevice->GetBitmap();
+//      pClone->CompositeBitmap(0, 0, pClone->GetWidth(), pClone->GetHeight(),
+//                              pForeBitmap, rect.left, rect.top,
+//                              BlendMode::kNormal, nullptr, false);
+//      left = std::min(left, 0);
+//      top = std::min(top, 0);
+//      if (pDIBitmap->IsMaskFormat()) {
+//        pClone->CompositeMask(0, 0, pClone->GetWidth(), pClone->GetHeight(),
+//                              pDIBitmap, mask_argb, left, top, blend_mode,
+//                              nullptr, false);
+//      } else {
+//        pClone->CompositeBitmap(0, 0, pClone->GetWidth(), pClone->GetHeight(),
+//                                pDIBitmap, left, top, blend_mode, nullptr,
+//                                false);
+//      }
+//    } else {
+//      pClone = pDIBitmap;
+//    }
+//    if (m_pDevice->GetBackDrop()) {
+//      m_pDevice->SetDIBits(pClone, rect.left, rect.top);
+//    } else {
+//      if (!pDIBitmap->IsMaskFormat()) {
+//        m_pDevice->SetDIBitsWithBlend(pDIBitmap, rect.left, rect.top,
+//                                      blend_mode);
+//      }
+//    }
+//    return;
+//  }
+//  FX_RECT bbox = GetClippedBBox(FX_RECT(left, top, left + pDIBitmap->GetWidth(),
+//                                        top + pDIBitmap->GetHeight()));
+//  RetainPtr<CFX_DIBitmap> pBackdrop = GetBackdrop(
+//      m_pCurObj.Get(), bbox, blend_mode != BlendMode::kNormal && bIsolated);
+//  if (!pBackdrop)
+//    return;
+//
+//  if (pDIBitmap->IsMaskFormat()) {
+//    pBackdrop->CompositeMask(left - bbox.left, top - bbox.top,
+//                             pDIBitmap->GetWidth(), pDIBitmap->GetHeight(),
+//                             pDIBitmap, mask_argb, 0, 0, blend_mode, nullptr,
+//                             false);
+//  } else {
+//    pBackdrop->CompositeBitmap(left - bbox.left, top - bbox.top,
+//                               pDIBitmap->GetWidth(), pDIBitmap->GetHeight(),
+//                               pDIBitmap, 0, 0, blend_mode, nullptr, false);
+//  }
+//
+//  auto pBackdrop1 = pdfium::MakeRetain<CFX_DIBitmap>();
+//  pBackdrop1->Create(pBackdrop->GetWidth(), pBackdrop->GetHeight(),
+//                     FXDIB_Format::kRgb32);
+//  pBackdrop1->Clear((uint32_t)-1);
+//  pBackdrop1->CompositeBitmap(0, 0, pBackdrop->GetWidth(),
+//                              pBackdrop->GetHeight(), pBackdrop, 0, 0,
+//                              BlendMode::kNormal, nullptr, false);
+//  pBackdrop = std::move(pBackdrop1);
+//  m_pDevice->SetDIBits(pBackdrop, bbox.left, bbox.top);
 }
 
 RetainPtr<CFX_DIBitmap> CPDF_RenderStatus::LoadSMask(
     CPDF_Dictionary* pSMaskDict,
     FX_RECT* pClipRect,
     const CFX_Matrix& mtMatrix) {
-  if (!pSMaskDict)
-    return nullptr;
-
-  CPDF_Stream* pGroup = pSMaskDict->GetStreamFor(pdfium::transparency::kG);
-  if (!pGroup)
-    return nullptr;
-
-  std::unique_ptr<CPDF_Function> pFunc;
-  const CPDF_Object* pFuncObj =
-      pSMaskDict->GetDirectObjectFor(pdfium::transparency::kTR);
-  if (pFuncObj && (pFuncObj->IsDictionary() || pFuncObj->IsStream()))
-    pFunc = CPDF_Function::Load(pFuncObj);
-
-  CFX_Matrix matrix = mtMatrix;
-  matrix.Translate(-pClipRect->left, -pClipRect->top);
-
-  CPDF_Form form(m_pContext->GetDocument(), m_pContext->GetPageResources(),
-                 pGroup);
-  form.ParseContent();
-
-  CFX_DefaultRenderDevice bitmap_device;
-  bool bLuminosity =
-      pSMaskDict->GetStringFor(pdfium::transparency::kSoftMaskSubType) !=
-      pdfium::transparency::kAlpha;
-  int width = pClipRect->right - pClipRect->left;
-  int height = pClipRect->bottom - pClipRect->top;
-  FXDIB_Format format;
-#if BUILDFLAG(IS_APPLE) || defined(_SKIA_SUPPORT_) || \
-    defined(_SKIA_SUPPORT_PATHS_)
-  format = bLuminosity ? FXDIB_Format::kRgb32 : FXDIB_Format::k8bppMask;
-#else
-  format = bLuminosity ? FXDIB_Format::kRgb : FXDIB_Format::k8bppMask;
-#endif
-  if (!bitmap_device.Create(width, height, format, nullptr))
-    return nullptr;
-
-  RetainPtr<CFX_DIBitmap> bitmap = bitmap_device.GetBitmap();
-  CPDF_ColorSpace::Family nCSFamily = CPDF_ColorSpace::Family::kUnknown;
-  if (bLuminosity) {
-    FX_ARGB back_color =
-        GetBackColor(pSMaskDict, pGroup->GetDict(), &nCSFamily);
-    bitmap->Clear(back_color);
-  } else {
-    bitmap->Clear(0);
-  }
-
-  const CPDF_Dictionary* pFormResource =
-      form.GetDict()->GetDictFor("Resources");
-  CPDF_RenderOptions options;
-  options.SetColorMode(bLuminosity ? CPDF_RenderOptions::kNormal
-                                   : CPDF_RenderOptions::kAlpha);
-  CPDF_RenderStatus status(m_pContext.Get(), &bitmap_device);
-  status.SetOptions(options);
-  status.SetGroupFamily(nCSFamily);
-  status.SetLoadMask(bLuminosity);
-  status.SetStdCS(true);
-  status.SetFormResource(pFormResource);
-  status.SetDropObjects(m_bDropObjects);
-  status.Initialize(nullptr, nullptr);
-  status.RenderObjectList(&form, matrix);
-
-  auto pMask = pdfium::MakeRetain<CFX_DIBitmap>();
-  if (!pMask->Create(width, height, FXDIB_Format::k8bppMask))
-    return nullptr;
-
-  uint8_t* dest_buf = pMask->GetBuffer();
-  int dest_pitch = pMask->GetPitch();
-  uint8_t* src_buf = bitmap->GetBuffer();
-  int src_pitch = bitmap->GetPitch();
-  std::vector<uint8_t, FxAllocAllocator<uint8_t>> transfers(256);
-  if (pFunc) {
-    std::vector<float> results(pFunc->CountOutputs());
-    for (size_t i = 0; i < transfers.size(); ++i) {
-      float input = i / 255.0f;
-      pFunc->Call(pdfium::make_span(&input, 1), results);
-      transfers[i] = FXSYS_roundf(results[0] * 255);
-    }
-  } else {
-    // Fill |transfers| with 0, 1, ... N.
-    std::iota(transfers.begin(), transfers.end(), 0);
-  }
-  if (bLuminosity) {
-    int Bpp = bitmap->GetBPP() / 8;
-    for (int row = 0; row < height; row++) {
-      uint8_t* dest_pos = dest_buf + row * dest_pitch;
-      uint8_t* src_pos = src_buf + row * src_pitch;
-      for (int col = 0; col < width; col++) {
-        *dest_pos++ = transfers[FXRGB2GRAY(src_pos[2], src_pos[1], *src_pos)];
-        src_pos += Bpp;
-      }
-    }
-  } else if (pFunc) {
-    int size = dest_pitch * height;
-    for (int i = 0; i < size; i++) {
-      dest_buf[i] = transfers[src_buf[i]];
-    }
-  } else {
-    memcpy(dest_buf, src_buf, dest_pitch * height);
-  }
-  return pMask;
+//  if (!pSMaskDict)
+//    return nullptr;
+//
+//  CPDF_Stream* pGroup = pSMaskDict->GetStreamFor(pdfium::transparency::kG);
+//  if (!pGroup)
+//    return nullptr;
+//
+//  std::unique_ptr<CPDF_Function> pFunc;
+//  const CPDF_Object* pFuncObj =
+//      pSMaskDict->GetDirectObjectFor(pdfium::transparency::kTR);
+//  if (pFuncObj && (pFuncObj->IsDictionary() || pFuncObj->IsStream()))
+//    pFunc = CPDF_Function::Load(pFuncObj);
+//
+//  CFX_Matrix matrix = mtMatrix;
+//  matrix.Translate(-pClipRect->left, -pClipRect->top);
+//
+//  CPDF_Form form(m_pContext->GetDocument(), m_pContext->GetPageResources(),
+//                 pGroup);
+//  form.ParseContent();
+//
+//  CFX_DefaultRenderDevice bitmap_device;
+//  bool bLuminosity =
+//      pSMaskDict->GetStringFor(pdfium::transparency::kSoftMaskSubType) !=
+//      pdfium::transparency::kAlpha;
+//  int width = pClipRect->right - pClipRect->left;
+//  int height = pClipRect->bottom - pClipRect->top;
+//  FXDIB_Format format;
+//#if BUILDFLAG(IS_APPLE) || defined(_SKIA_SUPPORT_) || \
+//    defined(_SKIA_SUPPORT_PATHS_)
+//  format = bLuminosity ? FXDIB_Format::kRgb32 : FXDIB_Format::k8bppMask;
+//#else
+//  format = bLuminosity ? FXDIB_Format::kRgb : FXDIB_Format::k8bppMask;
+//#endif
+//  if (!bitmap_device.Create(width, height, format, nullptr))
+//    return nullptr;
+//
+//  RetainPtr<CFX_DIBitmap> bitmap = bitmap_device.GetBitmap();
+//  CPDF_ColorSpace::Family nCSFamily = CPDF_ColorSpace::Family::kUnknown;
+//  if (bLuminosity) {
+//    FX_ARGB back_color =
+//        GetBackColor(pSMaskDict, pGroup->GetDict(), &nCSFamily);
+//    bitmap->Clear(back_color);
+//  } else {
+//    bitmap->Clear(0);
+//  }
+//
+//  const CPDF_Dictionary* pFormResource =
+//      form.GetDict()->GetDictFor("Resources");
+//  CPDF_RenderOptions options;
+//  options.SetColorMode(bLuminosity ? CPDF_RenderOptions::kNormal
+//                                   : CPDF_RenderOptions::kAlpha);
+//  CPDF_RenderStatus status(m_pContext.Get(), &bitmap_device);
+//  status.SetOptions(options);
+//  status.SetGroupFamily(nCSFamily);
+//  status.SetLoadMask(bLuminosity);
+//  status.SetStdCS(true);
+//  status.SetFormResource(pFormResource);
+//  status.SetDropObjects(m_bDropObjects);
+//  status.Initialize(nullptr, nullptr);
+//  status.RenderObjectList(&form, matrix);
+//
+//  auto pMask = pdfium::MakeRetain<CFX_DIBitmap>();
+//  if (!pMask->Create(width, height, FXDIB_Format::k8bppMask))
+//    return nullptr;
+//
+//  uint8_t* dest_buf = pMask->GetBuffer();
+//  int dest_pitch = pMask->GetPitch();
+//  uint8_t* src_buf = bitmap->GetBuffer();
+//  int src_pitch = bitmap->GetPitch();
+//  std::vector<uint8_t, FxAllocAllocator<uint8_t>> transfers(256);
+//  if (pFunc) {
+//    std::vector<float> results(pFunc->CountOutputs());
+//    for (size_t i = 0; i < transfers.size(); ++i) {
+//      float input = i / 255.0f;
+//      pFunc->Call(pdfium::make_span(&input, 1), results);
+//      transfers[i] = FXSYS_roundf(results[0] * 255);
+//    }
+//  } else {
+//    // Fill |transfers| with 0, 1, ... N.
+//    std::iota(transfers.begin(), transfers.end(), 0);
+//  }
+//  if (bLuminosity) {
+//    int Bpp = bitmap->GetBPP() / 8;
+//    for (int row = 0; row < height; row++) {
+//      uint8_t* dest_pos = dest_buf + row * dest_pitch;
+//      uint8_t* src_pos = src_buf + row * src_pitch;
+//      for (int col = 0; col < width; col++) {
+//        *dest_pos++ = transfers[FXRGB2GRAY(src_pos[2], src_pos[1], *src_pos)];
+//        src_pos += Bpp;
+//      }
+//    }
+//  } else if (pFunc) {
+//    int size = dest_pitch * height;
+//    for (int i = 0; i < size; i++) {
+//      dest_buf[i] = transfers[src_buf[i]];
+//    }
+//  } else {
+//    memcpy(dest_buf, src_buf, dest_pitch * height);
+//  }
+//  return pMask;
+  return nullptr;
 }
 
 FX_ARGB CPDF_RenderStatus::GetBackColor(const CPDF_Dictionary* pSMaskDict,
diff --git a/core/fpdfapi/render/cpdf_rendertiling.cpp b/core/fpdfapi/render/cpdf_rendertiling.cpp
index 2e0fc88a53..6fa68a21b4 100644
--- a/core/fpdfapi/render/cpdf_rendertiling.cpp
+++ b/core/fpdfapi/render/cpdf_rendertiling.cpp
@@ -17,7 +17,7 @@
 #include "core/fpdfapi/render/cpdf_renderoptions.h"
 #include "core/fpdfapi/render/cpdf_renderstatus.h"
 #include "core/fxcrt/fx_safe_types.h"
-#include "core/fxge/cfx_defaultrenderdevice.h"
+//#include "core/fxge/cfx_defaultrenderdevice.h"
 
 namespace {
 
@@ -30,38 +30,38 @@ RetainPtr<CFX_DIBitmap> DrawPatternBitmap(
     int width,
     int height,
     const CPDF_RenderOptions::Options& draw_options) {
-  auto pBitmap = pdfium::MakeRetain<CFX_DIBitmap>();
-  if (!pBitmap->Create(width, height,
-                       pPattern->colored() ? FXDIB_Format::kArgb
-                                           : FXDIB_Format::k8bppMask)) {
+//  auto pBitmap = pdfium::MakeRetain<CFX_DIBitmap>();
+//  if (!pBitmap->Create(width, height,
+//                       pPattern->colored() ? FXDIB_Format::kArgb
+//                                           : FXDIB_Format::k8bppMask)) {
     return nullptr;
-  }
-  CFX_DefaultRenderDevice bitmap_device;
-  bitmap_device.Attach(pBitmap, false, nullptr, false);
-  pBitmap->Clear(0);
-  CFX_FloatRect cell_bbox =
-      pPattern->pattern_to_form().TransformRect(pPattern->bbox());
-  cell_bbox = mtObject2Device.TransformRect(cell_bbox);
-  CFX_FloatRect bitmap_rect(0.0f, 0.0f, width, height);
-  CFX_Matrix mtAdjust;
-  mtAdjust.MatchRect(bitmap_rect, cell_bbox);
-
-  CFX_Matrix mtPattern2Bitmap = mtObject2Device * mtAdjust;
-  CPDF_RenderOptions options;
-  if (!pPattern->colored())
-    options.SetColorMode(CPDF_RenderOptions::kAlpha);
-
-  options.GetOptions() = draw_options;
-  options.GetOptions().bForceHalftone = true;
-
-  CPDF_RenderContext context(pDoc, nullptr, pCache);
-  context.AppendLayer(pPatternForm, mtPattern2Bitmap);
-  context.Render(&bitmap_device, nullptr, &options, nullptr);
-#if defined(_SKIA_SUPPORT_PATHS_)
-  bitmap_device.Flush(true);
-  pBitmap->UnPreMultiply();
-#endif
-  return pBitmap;
+//  }
+//  CFX_DefaultRenderDevice bitmap_device;
+//  bitmap_device.Attach(pBitmap, false, nullptr, false);
+//  pBitmap->Clear(0);
+//  CFX_FloatRect cell_bbox =
+//      pPattern->pattern_to_form().TransformRect(pPattern->bbox());
+//  cell_bbox = mtObject2Device.TransformRect(cell_bbox);
+//  CFX_FloatRect bitmap_rect(0.0f, 0.0f, width, height);
+//  CFX_Matrix mtAdjust;
+//  mtAdjust.MatchRect(bitmap_rect, cell_bbox);
+//
+//  CFX_Matrix mtPattern2Bitmap = mtObject2Device * mtAdjust;
+//  CPDF_RenderOptions options;
+//  if (!pPattern->colored())
+//    options.SetColorMode(CPDF_RenderOptions::kAlpha);
+//
+//  options.GetOptions() = draw_options;
+//  options.GetOptions().bForceHalftone = true;
+//
+//  CPDF_RenderContext context(pDoc, nullptr, pCache);
+//  context.AppendLayer(pPatternForm, mtPattern2Bitmap);
+//  context.Render(&bitmap_device, nullptr, &options, nullptr);
+//#if defined(_SKIA_SUPPORT_PATHS_)
+//  bitmap_device.Flush(true);
+//  pBitmap->UnPreMultiply();
+//#endif
+//  return pBitmap;
 }
 
 }  // namespace
@@ -75,175 +75,176 @@ RetainPtr<CFX_DIBitmap> CPDF_RenderTiling::Draw(
     const CFX_Matrix& mtObj2Device,
     const FX_RECT& clip_box,
     bool bStroke) {
-  const CFX_Matrix mtPattern2Device =
-      pPattern->pattern_to_form() * mtObj2Device;
-
-  CFX_FloatRect cell_bbox = mtPattern2Device.TransformRect(pPattern->bbox());
-
-  float ceil_height = std::ceil(cell_bbox.Height());
-  float ceil_width = std::ceil(cell_bbox.Width());
-
-  // Validate the float will fit into the int when the conversion is done.
-  if (!pdfium::base::IsValueInRangeForNumericType<int>(ceil_height) ||
-      !pdfium::base::IsValueInRangeForNumericType<int>(ceil_width)) {
-    return nullptr;
-  }
-
-  int width = static_cast<int>(ceil_width);
-  int height = static_cast<int>(ceil_height);
-  if (width <= 0)
-    width = 1;
-  if (height <= 0)
-    height = 1;
-
-  CFX_FloatRect clip_box_p =
-      mtPattern2Device.GetInverse().TransformRect(CFX_FloatRect(clip_box));
-  int min_col = static_cast<int>(
-      ceil((clip_box_p.left - pPattern->bbox().right) / pPattern->x_step()));
-  int max_col = static_cast<int>(
-      floor((clip_box_p.right - pPattern->bbox().left) / pPattern->x_step()));
-  int min_row = static_cast<int>(
-      ceil((clip_box_p.bottom - pPattern->bbox().top) / pPattern->y_step()));
-  int max_row = static_cast<int>(
-      floor((clip_box_p.top - pPattern->bbox().bottom) / pPattern->y_step()));
-
-  // Make sure we can fit the needed width * height into an int.
-  if (height > std::numeric_limits<int>::max() / width)
-    return nullptr;
-
-  CFX_RenderDevice* pDevice = pRenderStatus->GetRenderDevice();
-  CPDF_RenderContext* pContext = pRenderStatus->GetContext();
-  const CPDF_RenderOptions& options = pRenderStatus->GetRenderOptions();
-  if (width > clip_box.Width() || height > clip_box.Height() ||
-      width * height > clip_box.Width() * clip_box.Height()) {
-    std::unique_ptr<CPDF_GraphicStates> pStates;
-    if (!pPattern->colored())
-      pStates = CPDF_RenderStatus::CloneObjStates(pPageObj, bStroke);
-
-    const CPDF_Dictionary* pFormDict = pPatternForm->GetDict();
-    const CPDF_Dictionary* pFormResource = pFormDict->GetDictFor("Resources");
-    for (int col = min_col; col <= max_col; col++) {
-      for (int row = min_row; row <= max_row; row++) {
-        CFX_PointF original = mtPattern2Device.Transform(
-            CFX_PointF(col * pPattern->x_step(), row * pPattern->y_step()));
-        CFX_Matrix matrix = mtObj2Device;
-        matrix.Translate(original.x - mtPattern2Device.e,
-                         original.y - mtPattern2Device.f);
-        CFX_RenderDevice::StateRestorer restorer2(pDevice);
-        CPDF_RenderStatus status(pContext, pDevice);
-        status.SetOptions(options);
-        status.SetTransparency(pPatternForm->GetTransparency());
-        status.SetFormResource(pFormResource);
-        status.SetDropObjects(pRenderStatus->GetDropObjects());
-        status.Initialize(pRenderStatus, pStates.get());
-        status.RenderObjectList(pPatternForm, matrix);
-      }
-    }
-    return nullptr;
-  }
-
-  bool bAligned =
-      pPattern->bbox().left == 0 && pPattern->bbox().bottom == 0 &&
-      pPattern->bbox().right == pPattern->x_step() &&
-      pPattern->bbox().top == pPattern->y_step() &&
-      (mtPattern2Device.IsScaled() || mtPattern2Device.Is90Rotated());
-  if (bAligned) {
-    int orig_x = FXSYS_roundf(mtPattern2Device.e);
-    int orig_y = FXSYS_roundf(mtPattern2Device.f);
-    min_col = (clip_box.left - orig_x) / width;
-    if (clip_box.left < orig_x)
-      min_col--;
-
-    max_col = (clip_box.right - orig_x) / width;
-    if (clip_box.right <= orig_x)
-      max_col--;
-
-    min_row = (clip_box.top - orig_y) / height;
-    if (clip_box.top < orig_y)
-      min_row--;
-
-    max_row = (clip_box.bottom - orig_y) / height;
-    if (clip_box.bottom <= orig_y)
-      max_row--;
-  }
-  float left_offset = cell_bbox.left - mtPattern2Device.e;
-  float top_offset = cell_bbox.bottom - mtPattern2Device.f;
-  RetainPtr<CFX_DIBitmap> pPatternBitmap;
-  if (width * height < 16) {
-    RetainPtr<CFX_DIBitmap> pEnlargedBitmap = DrawPatternBitmap(
-        pContext->GetDocument(), pContext->GetPageCache(), pPattern,
-        pPatternForm, mtObj2Device, 8, 8, options.GetOptions());
-    pPatternBitmap = pEnlargedBitmap->StretchTo(
-        width, height, FXDIB_ResampleOptions(), nullptr);
-  } else {
-    pPatternBitmap = DrawPatternBitmap(
-        pContext->GetDocument(), pContext->GetPageCache(), pPattern,
-        pPatternForm, mtObj2Device, width, height, options.GetOptions());
-  }
-  if (!pPatternBitmap)
-    return nullptr;
-
-  if (options.ColorModeIs(CPDF_RenderOptions::kGray))
-    pPatternBitmap->ConvertColorScale(0, 0xffffff);
-
-  FX_ARGB fill_argb = pRenderStatus->GetFillArgb(pPageObj);
-  int clip_width = clip_box.right - clip_box.left;
-  int clip_height = clip_box.bottom - clip_box.top;
-  auto pScreen = pdfium::MakeRetain<CFX_DIBitmap>();
-  if (!pScreen->Create(clip_width, clip_height, FXDIB_Format::kArgb))
-    return nullptr;
-
-  pScreen->Clear(0);
-  const uint8_t* const src_buf = pPatternBitmap->GetBuffer();
-  for (int col = min_col; col <= max_col; col++) {
-    for (int row = min_row; row <= max_row; row++) {
-      int start_x;
-      int start_y;
-      if (bAligned) {
-        start_x =
-            FXSYS_roundf(mtPattern2Device.e) + col * width - clip_box.left;
-        start_y =
-            FXSYS_roundf(mtPattern2Device.f) + row * height - clip_box.top;
-      } else {
-        CFX_PointF original = mtPattern2Device.Transform(
-            CFX_PointF(col * pPattern->x_step(), row * pPattern->y_step()));
-
-        FX_SAFE_INT32 safeStartX = FXSYS_roundf(original.x + left_offset);
-        FX_SAFE_INT32 safeStartY = FXSYS_roundf(original.y + top_offset);
-
-        safeStartX -= clip_box.left;
-        safeStartY -= clip_box.top;
-        if (!safeStartX.IsValid() || !safeStartY.IsValid())
-          return nullptr;
-
-        start_x = safeStartX.ValueOrDie();
-        start_y = safeStartY.ValueOrDie();
-      }
-      if (width == 1 && height == 1) {
-        if (start_x < 0 || start_x >= clip_box.Width() || start_y < 0 ||
-            start_y >= clip_box.Height()) {
-          continue;
-        }
-        uint32_t* dest_buf = reinterpret_cast<uint32_t*>(
-            pScreen->GetWritableScanline(start_y).subspan(start_x * 4).data());
-        if (pPattern->colored()) {
-          const auto* src_buf32 = reinterpret_cast<const uint32_t*>(src_buf);
-          *dest_buf = *src_buf32;
-        } else {
-          *dest_buf = (*src_buf << 24) | (fill_argb & 0xffffff);
-        }
-      } else {
-        if (pPattern->colored()) {
-          pScreen->CompositeBitmap(start_x, start_y, width, height,
-                                   pPatternBitmap, 0, 0, BlendMode::kNormal,
-                                   nullptr, false);
-        } else {
-          pScreen->CompositeMask(start_x, start_y, width, height,
-                                 pPatternBitmap, fill_argb, 0, 0,
-                                 BlendMode::kNormal, nullptr, false);
-        }
-      }
-    }
-  }
-  return pScreen;
+  //const CFX_Matrix mtPattern2Device =
+  //    pPattern->pattern_to_form() * mtObj2Device;
+
+  //CFX_FloatRect cell_bbox = mtPattern2Device.TransformRect(pPattern->bbox());
+
+  //float ceil_height = std::ceil(cell_bbox.Height());
+  //float ceil_width = std::ceil(cell_bbox.Width());
+
+  //// Validate the float will fit into the int when the conversion is done.
+  //if (!pdfium::base::IsValueInRangeForNumericType<int>(ceil_height) ||
+  //    !pdfium::base::IsValueInRangeForNumericType<int>(ceil_width)) {
+  //  return nullptr;
+  //}
+
+  //int width = static_cast<int>(ceil_width);
+  //int height = static_cast<int>(ceil_height);
+  //if (width <= 0)
+  //  width = 1;
+  //if (height <= 0)
+  //  height = 1;
+
+  //CFX_FloatRect clip_box_p =
+  //    mtPattern2Device.GetInverse().TransformRect(CFX_FloatRect(clip_box));
+  //int min_col = static_cast<int>(
+  //    ceil((clip_box_p.left - pPattern->bbox().right) / pPattern->x_step()));
+  //int max_col = static_cast<int>(
+  //    floor((clip_box_p.right - pPattern->bbox().left) / pPattern->x_step()));
+  //int min_row = static_cast<int>(
+  //    ceil((clip_box_p.bottom - pPattern->bbox().top) / pPattern->y_step()));
+  //int max_row = static_cast<int>(
+  //    floor((clip_box_p.top - pPattern->bbox().bottom) / pPattern->y_step()));
+
+  //// Make sure we can fit the needed width * height into an int.
+  //if (height > std::numeric_limits<int>::max() / width)
+  //  return nullptr;
+
+  //CFX_RenderDevice* pDevice = pRenderStatus->GetRenderDevice();
+  //CPDF_RenderContext* pContext = pRenderStatus->GetContext();
+  //const CPDF_RenderOptions& options = pRenderStatus->GetRenderOptions();
+  //if (width > clip_box.Width() || height > clip_box.Height() ||
+  //    width * height > clip_box.Width() * clip_box.Height()) {
+  //  std::unique_ptr<CPDF_GraphicStates> pStates;
+  //  if (!pPattern->colored())
+  //    pStates = CPDF_RenderStatus::CloneObjStates(pPageObj, bStroke);
+
+  //  const CPDF_Dictionary* pFormDict = pPatternForm->GetDict();
+  //  const CPDF_Dictionary* pFormResource = pFormDict->GetDictFor("Resources");
+  //  for (int col = min_col; col <= max_col; col++) {
+  //    for (int row = min_row; row <= max_row; row++) {
+  //      CFX_PointF original = mtPattern2Device.Transform(
+  //          CFX_PointF(col * pPattern->x_step(), row * pPattern->y_step()));
+  //      CFX_Matrix matrix = mtObj2Device;
+  //      matrix.Translate(original.x - mtPattern2Device.e,
+  //                       original.y - mtPattern2Device.f);
+  //      CFX_RenderDevice::StateRestorer restorer2(pDevice);
+  //      CPDF_RenderStatus status(pContext, pDevice);
+  //      status.SetOptions(options);
+  //      status.SetTransparency(pPatternForm->GetTransparency());
+  //      status.SetFormResource(pFormResource);
+  //      status.SetDropObjects(pRenderStatus->GetDropObjects());
+  //      status.Initialize(pRenderStatus, pStates.get());
+  //      status.RenderObjectList(pPatternForm, matrix);
+  //    }
+  //  }
+  //  return nullptr;
+  //}
+
+  //bool bAligned =
+  //    pPattern->bbox().left == 0 && pPattern->bbox().bottom == 0 &&
+  //    pPattern->bbox().right == pPattern->x_step() &&
+  //    pPattern->bbox().top == pPattern->y_step() &&
+  //    (mtPattern2Device.IsScaled() || mtPattern2Device.Is90Rotated());
+  //if (bAligned) {
+  //  int orig_x = FXSYS_roundf(mtPattern2Device.e);
+  //  int orig_y = FXSYS_roundf(mtPattern2Device.f);
+  //  min_col = (clip_box.left - orig_x) / width;
+  //  if (clip_box.left < orig_x)
+  //    min_col--;
+
+  //  max_col = (clip_box.right - orig_x) / width;
+  //  if (clip_box.right <= orig_x)
+  //    max_col--;
+
+  //  min_row = (clip_box.top - orig_y) / height;
+  //  if (clip_box.top < orig_y)
+  //    min_row--;
+
+  //  max_row = (clip_box.bottom - orig_y) / height;
+  //  if (clip_box.bottom <= orig_y)
+  //    max_row--;
+  //}
+  //float left_offset = cell_bbox.left - mtPattern2Device.e;
+  //float top_offset = cell_bbox.bottom - mtPattern2Device.f;
+  //RetainPtr<CFX_DIBitmap> pPatternBitmap;
+  //if (width * height < 16) {
+  //  RetainPtr<CFX_DIBitmap> pEnlargedBitmap = DrawPatternBitmap(
+  //      pContext->GetDocument(), pContext->GetPageCache(), pPattern,
+  //      pPatternForm, mtObj2Device, 8, 8, options.GetOptions());
+  //  pPatternBitmap = pEnlargedBitmap->StretchTo(
+  //      width, height, FXDIB_ResampleOptions(), nullptr);
+  //} else {
+  //  pPatternBitmap = DrawPatternBitmap(
+  //      pContext->GetDocument(), pContext->GetPageCache(), pPattern,
+  //      pPatternForm, mtObj2Device, width, height, options.GetOptions());
+  //}
+  //if (!pPatternBitmap)
+  //  return nullptr;
+
+  //if (options.ColorModeIs(CPDF_RenderOptions::kGray))
+  //  pPatternBitmap->ConvertColorScale(0, 0xffffff);
+
+  //FX_ARGB fill_argb = pRenderStatus->GetFillArgb(pPageObj);
+  //int clip_width = clip_box.right - clip_box.left;
+  //int clip_height = clip_box.bottom - clip_box.top;
+  //auto pScreen = pdfium::MakeRetain<CFX_DIBitmap>();
+  //if (!pScreen->Create(clip_width, clip_height, FXDIB_Format::kArgb))
+  //  return nullptr;
+
+  //pScreen->Clear(0);
+  //const uint8_t* const src_buf = pPatternBitmap->GetBuffer();
+  //for (int col = min_col; col <= max_col; col++) {
+  //  for (int row = min_row; row <= max_row; row++) {
+  //    int start_x;
+  //    int start_y;
+  //    if (bAligned) {
+  //      start_x =
+  //          FXSYS_roundf(mtPattern2Device.e) + col * width - clip_box.left;
+  //      start_y =
+  //          FXSYS_roundf(mtPattern2Device.f) + row * height - clip_box.top;
+  //    } else {
+  //      CFX_PointF original = mtPattern2Device.Transform(
+  //          CFX_PointF(col * pPattern->x_step(), row * pPattern->y_step()));
+
+  //      FX_SAFE_INT32 safeStartX = FXSYS_roundf(original.x + left_offset);
+  //      FX_SAFE_INT32 safeStartY = FXSYS_roundf(original.y + top_offset);
+
+  //      safeStartX -= clip_box.left;
+  //      safeStartY -= clip_box.top;
+  //      if (!safeStartX.IsValid() || !safeStartY.IsValid())
+  //        return nullptr;
+
+  //      start_x = safeStartX.ValueOrDie();
+  //      start_y = safeStartY.ValueOrDie();
+  //    }
+  //    if (width == 1 && height == 1) {
+  //      if (start_x < 0 || start_x >= clip_box.Width() || start_y < 0 ||
+  //          start_y >= clip_box.Height()) {
+  //        continue;
+  //      }
+  //      uint32_t* dest_buf = reinterpret_cast<uint32_t*>(
+  //          pScreen->GetWritableScanline(start_y).subspan(start_x * 4).data());
+  //      if (pPattern->colored()) {
+  //        const auto* src_buf32 = reinterpret_cast<const uint32_t*>(src_buf);
+  //        *dest_buf = *src_buf32;
+  //      } else {
+  //        *dest_buf = (*src_buf << 24) | (fill_argb & 0xffffff);
+  //      }
+  //    } else {
+  //      if (pPattern->colored()) {
+  //        pScreen->CompositeBitmap(start_x, start_y, width, height,
+  //                                 pPatternBitmap, 0, 0, BlendMode::kNormal,
+  //                                 nullptr, false);
+  //      } else {
+  //        pScreen->CompositeMask(start_x, start_y, width, height,
+  //                               pPatternBitmap, fill_argb, 0, 0,
+  //                               BlendMode::kNormal, nullptr, false);
+  //      }
+  //    }
+  //  }
+  //}
+  //return pScreen;
+  return nullptr;
 }
diff --git a/core/fpdfapi/render/cpdf_windowsrenderdevice.cpp b/core/fpdfapi/render/cpdf_windowsrenderdevice.cpp
index 1d9cb4edf9..0a2e79a55f 100644
--- a/core/fpdfapi/render/cpdf_windowsrenderdevice.cpp
+++ b/core/fpdfapi/render/cpdf_windowsrenderdevice.cpp
@@ -11,14 +11,14 @@
 #include "core/fxcodec/basic/basicmodule.h"
 #include "core/fxcodec/fax/faxmodule.h"
 #include "core/fxcodec/flate/flatemodule.h"
-#include "core/fxcodec/jpeg/jpegmodule.h"
+//#include "core/fxcodec/jpeg/jpegmodule.h"
 #include "core/fxge/win32/cfx_psrenderer.h"
 
 namespace {
 
 constexpr EncoderIface kEncoderIface = {
     BasicModule::A85Encode, FaxModule::FaxEncode, FlateModule::Encode,
-    JpegModule::JpegEncode, BasicModule::RunLengthEncode};
+    /* JpegModule::JpegEncode, */nullptr, BasicModule::RunLengthEncode};
 
 }  // namespace
 
diff --git a/core/fpdfdoc/cpdf_action.h b/core/fpdfdoc/cpdf_action.h
index d4dba3212b..588aabdb83 100644
--- a/core/fpdfdoc/cpdf_action.h
+++ b/core/fpdfdoc/cpdf_action.h
@@ -12,7 +12,7 @@
 #include "core/fpdfdoc/cpdf_dest.h"
 #include "core/fxcrt/fx_string.h"
 #include "core/fxcrt/retain_ptr.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CPDF_Dictionary;
 class CPDF_Document;
diff --git a/core/fpdfdoc/cpdf_defaultappearance.h b/core/fpdfdoc/cpdf_defaultappearance.h
index 74eea7f42a..3b91d8aa3e 100644
--- a/core/fpdfdoc/cpdf_defaultappearance.h
+++ b/core/fpdfdoc/cpdf_defaultappearance.h
@@ -9,7 +9,7 @@
 
 #include "core/fxcrt/bytestring.h"
 #include "core/fxge/cfx_color.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CPDF_SimpleParser;
 
diff --git a/core/fpdfdoc/cpdf_formcontrol.h b/core/fpdfdoc/cpdf_formcontrol.h
index d47b720ee5..96997c8d18 100644
--- a/core/fpdfdoc/cpdf_formcontrol.h
+++ b/core/fpdfdoc/cpdf_formcontrol.h
@@ -22,7 +22,7 @@
 #include "core/fxcrt/unowned_ptr.h"
 #include "core/fxge/cfx_color.h"
 #include "core/fxge/dib/fx_dib.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CFX_RenderDevice;
 class CPDF_Dictionary;
diff --git a/core/fpdfdoc/cpdf_interactiveform.cpp b/core/fpdfdoc/cpdf_interactiveform.cpp
index 9c2fcd185f..39329e29ff 100644
--- a/core/fpdfdoc/cpdf_interactiveform.cpp
+++ b/core/fpdfdoc/cpdf_interactiveform.cpp
@@ -31,7 +31,7 @@
 #include "core/fxcrt/stl_util.h"
 #include "core/fxge/cfx_substfont.h"
 #include "core/fxge/fx_font.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/check.h"
 #include "third_party/base/containers/contains.h"
 #include "third_party/base/numerics/safe_conversions.h"
diff --git a/core/fpdfdoc/cpdf_pagelabel.h b/core/fpdfdoc/cpdf_pagelabel.h
index 6abc807310..5158d1872e 100644
--- a/core/fpdfdoc/cpdf_pagelabel.h
+++ b/core/fpdfdoc/cpdf_pagelabel.h
@@ -9,7 +9,7 @@
 
 #include "core/fxcrt/unowned_ptr.h"
 #include "core/fxcrt/widestring.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CPDF_Document;
 
diff --git a/core/fpdfdoc/cpdf_viewerpreferences.h b/core/fpdfdoc/cpdf_viewerpreferences.h
index 13c809f25a..17ba96bc7b 100644
--- a/core/fpdfdoc/cpdf_viewerpreferences.h
+++ b/core/fpdfdoc/cpdf_viewerpreferences.h
@@ -11,7 +11,7 @@
 
 #include "core/fxcrt/bytestring.h"
 #include "core/fxcrt/unowned_ptr.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CPDF_Array;
 class CPDF_Dictionary;
diff --git a/core/fpdftext/cpdf_linkextract.h b/core/fpdftext/cpdf_linkextract.h
index d44db70503..0b4b6873ba 100644
--- a/core/fpdftext/cpdf_linkextract.h
+++ b/core/fpdftext/cpdf_linkextract.h
@@ -15,7 +15,7 @@
 #include "core/fxcrt/fx_coordinates.h"
 #include "core/fxcrt/unowned_ptr.h"
 #include "core/fxcrt/widestring.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CPDF_TextPage;
 
diff --git a/core/fpdftext/cpdf_textpage.cpp b/core/fpdftext/cpdf_textpage.cpp
index 190f488ad9..ed0fe7283e 100644
--- a/core/fpdftext/cpdf_textpage.cpp
+++ b/core/fpdftext/cpdf_textpage.cpp
@@ -730,20 +730,24 @@ void CPDF_TextPage::CloseTempLine() {
     bPrevSpace = true;
   }
   CFX_BidiString bidi(str);
-  if (m_rtl)
-    bidi.SetOverallDirectionRight();
   CFX_BidiChar::Direction eCurrentDirection = bidi.OverallDirection();
-  for (const auto& segment : bidi) {
-    if (segment.direction == CFX_BidiChar::RIGHT ||
-        (segment.direction == CFX_BidiChar::NEUTRAL &&
-         eCurrentDirection == CFX_BidiChar::RIGHT)) {
-      eCurrentDirection = CFX_BidiChar::RIGHT;
-      for (int m = segment.start + segment.count; m > segment.start; --m)
-        AddCharInfoByRLDirection(str[m - 1], m_TempCharList[m - 1]);
-    } else {
-      eCurrentDirection = CFX_BidiChar::LEFT;
-      for (int m = segment.start; m < segment.start + segment.count; ++m)
-        AddCharInfoByLRDirection(str[m], m_TempCharList[m]);
+  if (eCurrentDirection == CFX_BidiChar::RIGHT) {
+    for (int i = 0; i < str.GetLength(); i++) {
+      AddCharInfoByRLDirection(bidi.CharAt(i), m_TempCharList[i]);
+    }
+  } else {
+    for (const auto& segment : bidi) {
+      if (segment.direction == CFX_BidiChar::RIGHT ||
+          (segment.direction == CFX_BidiChar::NEUTRAL &&
+           eCurrentDirection == CFX_BidiChar::RIGHT)) {
+        eCurrentDirection = CFX_BidiChar::RIGHT;
+        for (int m = segment.start + segment.count; m > segment.start; --m)
+          AddCharInfoByRLDirection(bidi.CharAt(m - 1), m_TempCharList[m - 1]);
+      } else {
+        eCurrentDirection = CFX_BidiChar::LEFT;
+        for (int m = segment.start; m < segment.start + segment.count; m++)
+          AddCharInfoByLRDirection(bidi.CharAt(m), m_TempCharList[m]);
+      }
     }
   }
   m_TempCharList.clear();
diff --git a/core/fpdftext/cpdf_textpage.h b/core/fpdftext/cpdf_textpage.h
index 627a297ded..0048bff6b6 100644
--- a/core/fpdftext/cpdf_textpage.h
+++ b/core/fpdftext/cpdf_textpage.h
@@ -17,7 +17,7 @@
 #include "core/fxcrt/fx_memory_wrappers.h"
 #include "core/fxcrt/unowned_ptr.h"
 #include "core/fxcrt/widestring.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CPDF_FormObject;
 class CPDF_Page;
diff --git a/core/fpdftext/cpdf_textpagefind.h b/core/fpdftext/cpdf_textpagefind.h
index e809ecf6b1..5574186b24 100644
--- a/core/fpdftext/cpdf_textpagefind.h
+++ b/core/fpdftext/cpdf_textpagefind.h
@@ -15,7 +15,7 @@
 #include "core/fxcrt/fx_coordinates.h"
 #include "core/fxcrt/unowned_ptr.h"
 #include "core/fxcrt/widestring.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CPDF_TextPage;
 
diff --git a/core/fxcodec/jbig2/CMakeLists.txt b/core/fxcodec/jbig2/CMakeLists.txt
new file mode 100644
index 0000000000..c4d85bd567
--- /dev/null
+++ b/core/fxcodec/jbig2/CMakeLists.txt
@@ -0,0 +1,24 @@
+project(internal_jbig2 DESCRIPTION "Internal jbig2 library of pdfium.")
+CMAKE_MINIMUM_REQUIRED (VERSION 2.8.12)
+
+if(WIN32)
+  add_definitions(-D_WIN32)
+else(WIN32)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+endif(WIN32)
+
+file(GLOB jbig2_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
+    "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
+
+file(GLOB to_remove "${CMAKE_CURRENT_SOURCE_DIR}/*unittest.cpp"
+    "${CMAKE_CURRENT_SOURCE_DIR}/*test.cpp")
+
+list(REMOVE_ITEM jbig2_SOURCES ${to_remove})
+
+add_library(${PROJECT_NAME} STATIC ${jbig2_SOURCES})
+
+target_include_directories(${PROJECT_NAME} PRIVATE  
+     ${CONAN_INCLUDE_DIRS}
+    )
+
+set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "parsing")
diff --git a/core/fxcodec/jbig2/JBig2_TrdProc.cpp b/core/fxcodec/jbig2/JBig2_TrdProc.cpp
index 38a4a2eba5..8696515e5f 100644
--- a/core/fxcodec/jbig2/JBig2_TrdProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_TrdProc.cpp
@@ -14,7 +14,7 @@
 #include "core/fxcodec/jbig2/JBig2_HuffmanDecoder.h"
 #include "core/fxcrt/fx_safe_types.h"
 #include "core/fxcrt/maybe_owned.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 namespace {
 
diff --git a/core/fxcodec/jpeg/jpeg_progressive_decoder.cpp b/core/fxcodec/jpeg/jpeg_progressive_decoder.cpp
index db61d34961..654097e78c 100644
--- a/core/fxcodec/jpeg/jpeg_progressive_decoder.cpp
+++ b/core/fxcodec/jpeg/jpeg_progressive_decoder.cpp
@@ -16,7 +16,7 @@
 #include "core/fxcrt/fx_safe_types.h"
 #include "core/fxge/dib/cfx_dibbase.h"
 #include "core/fxge/dib/fx_dib.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/check.h"
 #include "third_party/base/ptr_util.h"
 
diff --git a/core/fxcodec/jpeg/jpegmodule.cpp b/core/fxcodec/jpeg/jpegmodule.cpp
index fe2ee095cf..8f581dc53e 100644
--- a/core/fxcodec/jpeg/jpegmodule.cpp
+++ b/core/fxcodec/jpeg/jpegmodule.cpp
@@ -21,7 +21,7 @@
 #include "core/fxcrt/fx_safe_types.h"
 #include "core/fxge/dib/cfx_dibbase.h"
 #include "core/fxge/dib/fx_dib.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/check.h"
 #include "third_party/base/notreached.h"
 
diff --git a/core/fxcodec/jpeg/jpegmodule.h b/core/fxcodec/jpeg/jpegmodule.h
index 587942db45..16876dbcdf 100644
--- a/core/fxcodec/jpeg/jpegmodule.h
+++ b/core/fxcodec/jpeg/jpegmodule.h
@@ -12,7 +12,7 @@
 #include <memory>
 
 #include "build/build_config.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/span.h"
 
 #if BUILDFLAG(IS_WIN)
diff --git a/core/fxcodec/jpx/cjpx_decoder.cpp b/core/fxcodec/jpx/cjpx_decoder.cpp
index d8875786c8..41ba4824ad 100644
--- a/core/fxcodec/jpx/cjpx_decoder.cpp
+++ b/core/fxcodec/jpx/cjpx_decoder.cpp
@@ -15,7 +15,7 @@
 
 #include "core/fxcodec/jpx/jpx_decode_utils.h"
 #include "core/fxcrt/fx_safe_types.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/cxx17_backports.h"
 #include "third_party/base/ptr_util.h"
 
diff --git a/core/fxcrt/bytestring.h b/core/fxcrt/bytestring.h
index 8798893718..663b689453 100644
--- a/core/fxcrt/bytestring.h
+++ b/core/fxcrt/bytestring.h
@@ -21,7 +21,7 @@
 #include "core/fxcrt/retain_ptr.h"
 #include "core/fxcrt/string_data_template.h"
 #include "core/fxcrt/string_view_template.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/check.h"
 #include "third_party/base/compiler_specific.h"
 #include "third_party/base/span.h"
diff --git a/core/fxcrt/css/cfx_csscomputedstyle.h b/core/fxcrt/css/cfx_csscomputedstyle.h
index a6085893f8..dbb638cbd1 100644
--- a/core/fxcrt/css/cfx_csscomputedstyle.h
+++ b/core/fxcrt/css/cfx_csscomputedstyle.h
@@ -15,7 +15,7 @@
 #include "core/fxcrt/retain_ptr.h"
 #include "core/fxcrt/widestring.h"
 #include "core/fxge/dib/fx_dib.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CFX_CSSValueList;
 
diff --git a/core/fxcrt/fx_bidi.h b/core/fxcrt/fx_bidi.h
index 9bc0b17c18..7ec749c2d2 100644
--- a/core/fxcrt/fx_bidi.h
+++ b/core/fxcrt/fx_bidi.h
@@ -59,6 +59,7 @@ class CFX_BidiString {
   // Force the overall direction to be R2L regardless of what was detected.
   void SetOverallDirectionRight();
 
+  auto CharAt(size_t x) const { return m_Str[x]; }
   const_iterator begin() const { return m_Order.begin(); }
   const_iterator end() const { return m_Order.end(); }
 
diff --git a/core/fxcrt/string_view_template.h b/core/fxcrt/string_view_template.h
index 4c49877558..740870553b 100644
--- a/core/fxcrt/string_view_template.h
+++ b/core/fxcrt/string_view_template.h
@@ -15,7 +15,7 @@
 #include <vector>
 
 #include "core/fxcrt/fx_system.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/span.h"
 
 namespace fxcrt {
diff --git a/core/fxcrt/widestring.h b/core/fxcrt/widestring.h
index 7806aa6796..1630529ae3 100644
--- a/core/fxcrt/widestring.h
+++ b/core/fxcrt/widestring.h
@@ -20,7 +20,7 @@
 #include "core/fxcrt/retain_ptr.h"
 #include "core/fxcrt/string_data_template.h"
 #include "core/fxcrt/string_view_template.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/check.h"
 #include "third_party/base/compiler_specific.h"
 #include "third_party/base/span.h"
diff --git a/core/fxcrt/xml/cfx_xmlparser.h b/core/fxcrt/xml/cfx_xmlparser.h
index ed51dfce05..e9ca098b1a 100644
--- a/core/fxcrt/xml/cfx_xmlparser.h
+++ b/core/fxcrt/xml/cfx_xmlparser.h
@@ -13,7 +13,7 @@
 #include "core/fxcrt/fx_memory_wrappers.h"
 #include "core/fxcrt/retain_ptr.h"
 #include "core/fxcrt/widestring.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CFX_SeekableStreamProxy;
 class CFX_XMLDocument;
diff --git a/core/fxge/calculate_pitch.h b/core/fxge/calculate_pitch.h
index 09b35d68e0..de15a7d261 100644
--- a/core/fxge/calculate_pitch.h
+++ b/core/fxge/calculate_pitch.h
@@ -7,7 +7,7 @@
 
 #include <stdint.h>
 
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 namespace fxge {
 
diff --git a/core/fxge/cfx_font.h b/core/fxge/cfx_font.h
index b506f3654b..21abfd70f7 100644
--- a/core/fxge/cfx_font.h
+++ b/core/fxge/cfx_font.h
@@ -18,7 +18,7 @@
 #include "core/fxcrt/retain_ptr.h"
 #include "core/fxge/cfx_face.h"
 #include "core/fxge/fx_freetype.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/span.h"
 
 #if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
diff --git a/core/fxge/cfx_fontmapper.h b/core/fxge/cfx_fontmapper.h
index 2ad6c3eee0..ee6946d5b8 100644
--- a/core/fxge/cfx_fontmapper.h
+++ b/core/fxge/cfx_fontmapper.h
@@ -18,7 +18,7 @@
 #include "core/fxcrt/retain_ptr.h"
 #include "core/fxcrt/unowned_ptr.h"
 #include "core/fxge/cfx_face.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CFX_FontMgr;
 class CFX_SubstFont;
diff --git a/core/fxge/cfx_path.h b/core/fxge/cfx_path.h
index 357df59656..731622c0da 100644
--- a/core/fxge/cfx_path.h
+++ b/core/fxge/cfx_path.h
@@ -13,7 +13,7 @@
 
 #include "core/fxcrt/fx_coordinates.h"
 #include "core/fxcrt/retain_ptr.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CFX_Path {
  public:
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index 0539fbe761..79e899dac7 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -15,7 +15,7 @@
 #include "build/build_config.h"
 #include "core/fxcrt/fx_safe_types.h"
 #include "core/fxge/cfx_color.h"
-#include "core/fxge/cfx_defaultrenderdevice.h"
+//#include "core/fxge/cfx_defaultrenderdevice.h"
 #include "core/fxge/cfx_fillrenderoptions.h"
 #include "core/fxge/cfx_font.h"
 #include "core/fxge/cfx_fontmgr.h"
@@ -745,53 +745,53 @@ bool CFX_RenderDevice::DrawFillStrokePath(
     uint32_t stroke_color,
     const CFX_FillRenderOptions& fill_options,
     BlendMode blend_type) {
-  if (!(m_RenderCaps & FXRC_GET_BITS))
-    return false;
-  CFX_FloatRect bbox;
-  if (pGraphState) {
-    bbox = path.GetBoundingBoxForStrokePath(pGraphState->m_LineWidth,
-                                            pGraphState->m_MiterLimit);
-  } else {
-    bbox = path.GetBoundingBox();
-  }
-  if (pObject2Device)
-    bbox = pObject2Device->TransformRect(bbox);
-
-  FX_RECT rect = bbox.GetOuterRect();
-  if (!rect.Valid())
-    return false;
-
-  auto bitmap = pdfium::MakeRetain<CFX_DIBitmap>();
-  auto backdrop = pdfium::MakeRetain<CFX_DIBitmap>();
-  if (!CreateCompatibleBitmap(bitmap, rect.Width(), rect.Height()))
-    return false;
-
-  if (bitmap->IsAlphaFormat()) {
-    bitmap->Clear(0);
-    backdrop->Copy(bitmap);
-  } else {
-    if (!m_pDeviceDriver->GetDIBits(bitmap, rect.left, rect.top))
-      return false;
-    backdrop->Copy(bitmap);
-  }
-  CFX_DefaultRenderDevice bitmap_device;
-  bitmap_device.Attach(bitmap, false, backdrop, true);
-
-  CFX_Matrix matrix;
-  if (pObject2Device)
-    matrix = *pObject2Device;
-  matrix.Translate(-rect.left, -rect.top);
-  if (!bitmap_device.GetDeviceDriver()->DrawPath(path, &matrix, pGraphState,
-                                                 fill_color, stroke_color,
-                                                 fill_options, blend_type)) {
+ // if (!(m_RenderCaps & FXRC_GET_BITS))
     return false;
-  }
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
-  bitmap_device.GetDeviceDriver()->Flush();
-#endif
-  FX_RECT src_rect(0, 0, rect.Width(), rect.Height());
-  return m_pDeviceDriver->SetDIBits(bitmap, 0, src_rect, rect.left, rect.top,
-                                    BlendMode::kNormal);
+//  CFX_FloatRect bbox;
+//  if (pGraphState) {
+//    bbox = path.GetBoundingBoxForStrokePath(pGraphState->m_LineWidth,
+//                                            pGraphState->m_MiterLimit);
+//  } else {
+//    bbox = path.GetBoundingBox();
+//  }
+//  if (pObject2Device)
+//    bbox = pObject2Device->TransformRect(bbox);
+//
+//  FX_RECT rect = bbox.GetOuterRect();
+//  if (!rect.Valid())
+//    return false;
+//
+//  auto bitmap = pdfium::MakeRetain<CFX_DIBitmap>();
+//  auto backdrop = pdfium::MakeRetain<CFX_DIBitmap>();
+//  if (!CreateCompatibleBitmap(bitmap, rect.Width(), rect.Height()))
+//    return false;
+//
+//  if (bitmap->IsAlphaFormat()) {
+//    bitmap->Clear(0);
+//    backdrop->Copy(bitmap);
+//  } else {
+//    if (!m_pDeviceDriver->GetDIBits(bitmap, rect.left, rect.top))
+//      return false;
+//    backdrop->Copy(bitmap);
+//  }
+//  CFX_DefaultRenderDevice bitmap_device;
+//  bitmap_device.Attach(bitmap, false, backdrop, true);
+//
+//  CFX_Matrix matrix;
+//  if (pObject2Device)
+//    matrix = *pObject2Device;
+//  matrix.Translate(-rect.left, -rect.top);
+//  if (!bitmap_device.GetDeviceDriver()->DrawPath(path, &matrix, pGraphState,
+//                                                 fill_color, stroke_color,
+//                                                 fill_options, blend_type)) {
+//    return false;
+//  }
+//#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+//  bitmap_device.GetDeviceDriver()->Flush();
+//#endif
+//  FX_RECT src_rect(0, 0, rect.Width(), rect.Height());
+//  return m_pDeviceDriver->SetDIBits(bitmap, 0, src_rect, rect.left, rect.top,
+//                                    BlendMode::kNormal);
 }
 
 bool CFX_RenderDevice::FillRectWithBlend(const FX_RECT& rect,
diff --git a/core/fxge/dib/cfx_dibitmap.h b/core/fxge/dib/cfx_dibitmap.h
index 7e5d0522db..fc5b87368a 100644
--- a/core/fxge/dib/cfx_dibitmap.h
+++ b/core/fxge/dib/cfx_dibitmap.h
@@ -12,7 +12,7 @@
 #include "core/fxcrt/retain_ptr.h"
 #include "core/fxge/dib/cfx_dibbase.h"
 #include "core/fxge/dib/fx_dib.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CFX_DIBitmap final : public CFX_DIBBase {
  public:
diff --git a/core/fxge/text_glyph_pos.h b/core/fxge/text_glyph_pos.h
index af8c3935ce..d283f55af5 100644
--- a/core/fxge/text_glyph_pos.h
+++ b/core/fxge/text_glyph_pos.h
@@ -10,7 +10,7 @@
 #include "core/fxcrt/fx_coordinates.h"
 
 #include "core/fxcrt/unowned_ptr.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CFX_GlyphBitmap;
 
diff --git a/core/fxge/win32/cfx_psrenderer.h b/core/fxge/win32/cfx_psrenderer.h
index be88677374..0a06163a1f 100644
--- a/core/fxge/win32/cfx_psrenderer.h
+++ b/core/fxge/win32/cfx_psrenderer.h
@@ -22,7 +22,7 @@
 #include "core/fxcrt/retain_ptr.h"
 #include "core/fxcrt/unowned_ptr.h"
 #include "core/fxge/cfx_graphstatedata.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/span.h"
 
 class CFX_DIBBase;
diff --git a/core/fxge/win32/cfx_psrenderer_unittest.cpp b/core/fxge/win32/cfx_psrenderer_unittest.cpp
index c7012655aa..e75612a832 100644
--- a/core/fxge/win32/cfx_psrenderer_unittest.cpp
+++ b/core/fxge/win32/cfx_psrenderer_unittest.cpp
@@ -5,7 +5,7 @@
 #include "core/fxge/win32/cfx_psrenderer.h"
 #include "core/fxcrt/bytestring.h"
 #include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/span.h"
 
 TEST(PSRendererTest, GenerateType42SfntData) {
diff --git a/core/fxge/win32/cgdi_device_driver.h b/core/fxge/win32/cgdi_device_driver.h
index 20a8e55649..91e2a658da 100644
--- a/core/fxge/win32/cgdi_device_driver.h
+++ b/core/fxge/win32/cgdi_device_driver.h
@@ -11,7 +11,7 @@
 
 #include "core/fxcrt/retain_ptr.h"
 #include "core/fxge/renderdevicedriver_iface.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CGdiDeviceDriver : public RenderDeviceDriverIface {
  protected:
diff --git a/fpdfsdk/cpdfsdk_appstream.h b/fpdfsdk/cpdfsdk_appstream.h
index 5709ba372e..d1c10fcef0 100644
--- a/fpdfsdk/cpdfsdk_appstream.h
+++ b/fpdfsdk/cpdfsdk_appstream.h
@@ -10,7 +10,7 @@
 #include "core/fxcrt/fx_string.h"
 #include "core/fxcrt/retain_ptr.h"
 #include "core/fxcrt/unowned_ptr.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CPDFSDK_Widget;
 class CPDF_Dictionary;
diff --git a/fpdfsdk/cpdfsdk_interactiveform.h b/fpdfsdk/cpdfsdk_interactiveform.h
index f536536bc1..86be2c6d90 100644
--- a/fpdfsdk/cpdfsdk_interactiveform.h
+++ b/fpdfsdk/cpdfsdk_interactiveform.h
@@ -16,7 +16,7 @@
 #include "core/fxcrt/unowned_ptr.h"
 #include "core/fxge/dib/fx_dib.h"
 #include "fpdfsdk/cpdfsdk_widget.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CPDF_Dictionary;
 class CPDF_FormControl;
diff --git a/fpdfsdk/cpdfsdk_widget.h b/fpdfsdk/cpdfsdk_widget.h
index 2b373a1806..55fede693c 100644
--- a/fpdfsdk/cpdfsdk_widget.h
+++ b/fpdfsdk/cpdfsdk_widget.h
@@ -16,7 +16,7 @@
 #include "core/fxcrt/widestring.h"
 #include "core/fxge/cfx_color.h"
 #include "fpdfsdk/cpdfsdk_baannot.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CFX_RenderDevice;
 class CPDF_Annot;
diff --git a/fpdfsdk/fpdf_editimg.cpp b/fpdfsdk/fpdf_editimg.cpp
index 4f63807939..9cbe60f954 100644
--- a/fpdfsdk/fpdf_editimg.cpp
+++ b/fpdfsdk/fpdf_editimg.cpp
@@ -210,53 +210,53 @@ FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV
 FPDFImageObj_GetRenderedBitmap(FPDF_DOCUMENT document,
                                FPDF_PAGE page,
                                FPDF_PAGEOBJECT image_object) {
-  CPDF_Document* doc = CPDFDocumentFromFPDFDocument(document);
-  if (!doc)
+  //CPDF_Document* doc = CPDFDocumentFromFPDFDocument(document);
+  //if (!doc)
     return nullptr;
 
-  CPDF_Page* optional_page = CPDFPageFromFPDFPage(page);
-  if (optional_page && optional_page->GetDocument() != doc)
-    return nullptr;
-
-  CPDF_ImageObject* image = CPDFImageObjectFromFPDFPageObject(image_object);
-  if (!image)
-    return nullptr;
-
-  // Create |result_bitmap|.
-  const CFX_Matrix& image_matrix = image->matrix();
-  int output_width = image_matrix.a;
-  int output_height = image_matrix.d;
-  auto result_bitmap = pdfium::MakeRetain<CFX_DIBitmap>();
-  if (!result_bitmap->Create(output_width, output_height, FXDIB_Format::kArgb))
-    return nullptr;
-
-  // Set up all the rendering code.
-  CPDF_Dictionary* page_resources =
-      optional_page ? optional_page->GetPageResources() : nullptr;
-  CPDF_RenderContext context(doc, page_resources, /*pPageCache=*/nullptr);
-  CFX_DefaultRenderDevice device;
-  device.Attach(result_bitmap, /*bRgbByteOrder=*/false,
-                /*pBackdropBitmap=*/nullptr, /*bGroupKnockout=*/false);
-  CPDF_RenderStatus status(&context, &device);
-  CPDF_ImageRenderer renderer;
-
-  // Need to first flip the image, as expected by |renderer|.
-  CFX_Matrix render_matrix(1, 0, 0, -1, 0, output_height);
-
-  // Then take |image_matrix|'s offset into account.
-  render_matrix.Translate(-image_matrix.e, image_matrix.f);
-
-  // Do the actual rendering.
-  bool should_continue = renderer.Start(&status, image, render_matrix,
-                                        /*bStdCS=*/false, BlendMode::kNormal);
-  while (should_continue)
-    should_continue = renderer.Continue(/*pPause=*/nullptr);
-
-  if (!renderer.GetResult())
-    return nullptr;
-
-  // Caller takes ownership.
-  return FPDFBitmapFromCFXDIBitmap(result_bitmap.Leak());
+  //CPDF_Page* optional_page = CPDFPageFromFPDFPage(page);
+  //if (optional_page && optional_page->GetDocument() != doc)
+  //  return nullptr;
+
+  //CPDF_ImageObject* image = CPDFImageObjectFromFPDFPageObject(image_object);
+  //if (!image)
+  //  return nullptr;
+
+  //// Create |result_bitmap|.
+  //const CFX_Matrix& image_matrix = image->matrix();
+  //int output_width = image_matrix.a;
+  //int output_height = image_matrix.d;
+  //auto result_bitmap = pdfium::MakeRetain<CFX_DIBitmap>();
+  //if (!result_bitmap->Create(output_width, output_height, FXDIB_Format::kArgb))
+  //  return nullptr;
+
+  //// Set up all the rendering code.
+  //CPDF_Dictionary* page_resources =
+  //    optional_page ? optional_page->GetPageResources() : nullptr;
+  //CPDF_RenderContext context(doc, page_resources, /*pPageCache=*/nullptr);
+  //CFX_DefaultRenderDevice device;
+  //device.Attach(result_bitmap, /*bRgbByteOrder=*/false,
+  //              /*pBackdropBitmap=*/nullptr, /*bGroupKnockout=*/false);
+  //CPDF_RenderStatus status(&context, &device);
+  //CPDF_ImageRenderer renderer;
+
+  //// Need to first flip the image, as expected by |renderer|.
+  //CFX_Matrix render_matrix(1, 0, 0, -1, 0, output_height);
+
+  //// Then take |image_matrix|'s offset into account.
+  //render_matrix.Translate(-image_matrix.e, image_matrix.f);
+
+  //// Do the actual rendering.
+  //bool should_continue = renderer.Start(&status, image, render_matrix,
+  //                                      /*bStdCS=*/false, BlendMode::kNormal);
+  //while (should_continue)
+  //  should_continue = renderer.Continue(/*pPause=*/nullptr);
+
+  //if (!renderer.GetResult())
+  //  return nullptr;
+
+  //// Caller takes ownership.
+  //return FPDFBitmapFromCFXDIBitmap(result_bitmap.Leak());
 }
 
 FPDF_EXPORT unsigned long FPDF_CALLCONV
diff --git a/fpdfsdk/fpdf_formfill.cpp b/fpdfsdk/fpdf_formfill.cpp
index 089c1d3e26..a035f1e92f 100644
--- a/fpdfsdk/fpdf_formfill.cpp
+++ b/fpdfsdk/fpdf_formfill.cpp
@@ -182,49 +182,49 @@ void FFLCommon(FPDF_FORMHANDLE hHandle,
                int size_y,
                int rotate,
                int flags) {
-  if (!hHandle)
-    return;
-
-  IPDF_Page* pPage = IPDFPageFromFPDFPage(fpdf_page);
-  if (!pPage)
+  //if (!hHandle)
     return;
-
-  CPDF_Document* pPDFDoc = pPage->GetDocument();
-  CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, fpdf_page);
-
-  const FX_RECT rect(start_x, start_y, start_x + size_x, start_y + size_y);
-  CFX_Matrix matrix = pPage->GetDisplayMatrix(rect, rotate);
-
-  auto pDevice = std::make_unique<CFX_DefaultRenderDevice>();
-#if defined(_SKIA_SUPPORT_)
-  pDevice->AttachRecorder(static_cast<SkPictureRecorder*>(recorder));
-#endif
-
-  RetainPtr<CFX_DIBitmap> holder(CFXDIBitmapFromFPDFBitmap(bitmap));
-  pDevice->Attach(holder, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false);
-  {
-    CFX_RenderDevice::StateRestorer restorer(pDevice.get());
-    pDevice->SetClip_Rect(rect);
-
-    CPDF_RenderOptions options;
-    options.GetOptions().bClearType = !!(flags & FPDF_LCD_TEXT);
-
-    // Grayscale output
-    if (flags & FPDF_GRAYSCALE)
-      options.SetColorMode(CPDF_RenderOptions::kGray);
-
-    options.SetDrawAnnots(flags & FPDF_ANNOT);
-    options.SetOCContext(
-        pdfium::MakeRetain<CPDF_OCContext>(pPDFDoc, CPDF_OCContext::kView));
-
-    if (pPageView)
-      pPageView->PageView_OnDraw(pDevice.get(), matrix, &options, rect);
-  }
-
-#if defined(_SKIA_SUPPORT_PATHS_)
-  pDevice->Flush(true);
-  holder->UnPreMultiply();
-#endif
+//
+//  IPDF_Page* pPage = IPDFPageFromFPDFPage(fpdf_page);
+//  if (!pPage)
+//    return;
+//
+//  CPDF_Document* pPDFDoc = pPage->GetDocument();
+//  CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, fpdf_page);
+//
+//  const FX_RECT rect(start_x, start_y, start_x + size_x, start_y + size_y);
+//  CFX_Matrix matrix = pPage->GetDisplayMatrix(rect, rotate);
+//
+//  auto pDevice = std::make_unique<CFX_DefaultRenderDevice>();
+//#if defined(_SKIA_SUPPORT_)
+//  pDevice->AttachRecorder(static_cast<SkPictureRecorder*>(recorder));
+//#endif
+//
+//  RetainPtr<CFX_DIBitmap> holder(CFXDIBitmapFromFPDFBitmap(bitmap));
+//  pDevice->Attach(holder, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false);
+//  {
+//    CFX_RenderDevice::StateRestorer restorer(pDevice.get());
+//    pDevice->SetClip_Rect(rect);
+//
+//    CPDF_RenderOptions options;
+//    options.GetOptions().bClearType = !!(flags & FPDF_LCD_TEXT);
+//
+//    // Grayscale output
+//    if (flags & FPDF_GRAYSCALE)
+//      options.SetColorMode(CPDF_RenderOptions::kGray);
+//
+//    options.SetDrawAnnots(flags & FPDF_ANNOT);
+//    options.SetOCContext(
+//        pdfium::MakeRetain<CPDF_OCContext>(pPDFDoc, CPDF_OCContext::kView));
+//
+//    if (pPageView)
+//      pPageView->PageView_OnDraw(pDevice.get(), matrix, &options, rect);
+//  }
+//
+//#if defined(_SKIA_SUPPORT_PATHS_)
+//  pDevice->Flush(true);
+//  holder->UnPreMultiply();
+//#endif
 }
 
 // Returns true if formfill version is correctly set. See |version| in
diff --git a/fpdfsdk/fpdf_progressive.cpp b/fpdfsdk/fpdf_progressive.cpp
index 64dd02af4b..2bb3f2112c 100644
--- a/fpdfsdk/fpdf_progressive.cpp
+++ b/fpdfsdk/fpdf_progressive.cpp
@@ -52,39 +52,39 @@ FPDF_RenderPageBitmapWithColorScheme_Start(FPDF_BITMAP bitmap,
                                            int flags,
                                            const FPDF_COLORSCHEME* color_scheme,
                                            IFSDK_PAUSE* pause) {
-  if (!bitmap || !pause || pause->version != 1)
+  //if (!bitmap || !pause || pause->version != 1)
     return FPDF_RENDER_FAILED;
-
-  CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
-  if (!pPage)
-    return FPDF_RENDER_FAILED;
-
-  auto pOwnedContext = std::make_unique<CPDF_PageRenderContext>();
-  CPDF_PageRenderContext* pContext = pOwnedContext.get();
-  pPage->SetRenderContext(std::move(pOwnedContext));
-
-  RetainPtr<CFX_DIBitmap> pBitmap(CFXDIBitmapFromFPDFBitmap(bitmap));
-  auto pOwnedDevice = std::make_unique<CFX_DefaultRenderDevice>();
-  CFX_DefaultRenderDevice* pDevice = pOwnedDevice.get();
-  pContext->m_pDevice = std::move(pOwnedDevice);
-  pDevice->Attach(pBitmap, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false);
-
-  CPDFSDK_PauseAdapter pause_adapter(pause);
-  CPDFSDK_RenderPageWithContext(pContext, pPage, start_x, start_y, size_x,
-                                size_y, rotate, flags, color_scheme,
-                                /*need_to_restore=*/false, &pause_adapter);
-
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
-  pDevice->Flush(false);
-#endif
-#if defined(_SKIA_SUPPORT_PATHS_)
-  pBitmap->UnPreMultiply();
-#endif
-
-  if (!pContext->m_pRenderer)
-    return FPDF_RENDER_FAILED;
-
-  return ToFPDFStatus(pContext->m_pRenderer->GetStatus());
+//
+//  CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
+//  if (!pPage)
+//    return FPDF_RENDER_FAILED;
+//
+//  auto pOwnedContext = std::make_unique<CPDF_PageRenderContext>();
+//  CPDF_PageRenderContext* pContext = pOwnedContext.get();
+//  pPage->SetRenderContext(std::move(pOwnedContext));
+//
+//  RetainPtr<CFX_DIBitmap> pBitmap(CFXDIBitmapFromFPDFBitmap(bitmap));
+//  auto pOwnedDevice = std::make_unique<CFX_DefaultRenderDevice>();
+//  CFX_DefaultRenderDevice* pDevice = pOwnedDevice.get();
+//  pContext->m_pDevice = std::move(pOwnedDevice);
+//  pDevice->Attach(pBitmap, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false);
+//
+//  CPDFSDK_PauseAdapter pause_adapter(pause);
+//  CPDFSDK_RenderPageWithContext(pContext, pPage, start_x, start_y, size_x,
+//                                size_y, rotate, flags, color_scheme,
+//                                /*need_to_restore=*/false, &pause_adapter);
+//
+//#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+//  pDevice->Flush(false);
+//#endif
+//#if defined(_SKIA_SUPPORT_PATHS_)
+//  pBitmap->UnPreMultiply();
+//#endif
+//
+//  if (!pContext->m_pRenderer)
+//    return FPDF_RENDER_FAILED;
+//
+//  return ToFPDFStatus(pContext->m_pRenderer->GetStatus());
 }
 
 FPDF_EXPORT int FPDF_CALLCONV FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap,
diff --git a/fpdfsdk/fpdf_save.cpp b/fpdfsdk/fpdf_save.cpp
index 4fb5d3fbd7..cdc87baab0 100644
--- a/fpdfsdk/fpdf_save.cpp
+++ b/fpdfsdk/fpdf_save.cpp
@@ -22,7 +22,7 @@
 #include "fpdfsdk/cpdfsdk_filewriteadapter.h"
 #include "fpdfsdk/cpdfsdk_helpers.h"
 #include "public/fpdf_edit.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 #ifdef PDF_ENABLE_XFA
 #include "core/fpdfapi/parser/cpdf_stream.h"
diff --git a/fpdfsdk/fpdf_structtree_embeddertest.cpp b/fpdfsdk/fpdf_structtree_embeddertest.cpp
index 3417654c2a..e7eb0457f9 100644
--- a/fpdfsdk/fpdf_structtree_embeddertest.cpp
+++ b/fpdfsdk/fpdf_structtree_embeddertest.cpp
@@ -5,7 +5,7 @@
 #include "public/fpdf_structtree.h"
 #include "testing/embedder_test.h"
 #include "testing/fx_string_testhelpers.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/cxx17_backports.h"
 
 class FPDFStructTreeEmbedderTest : public EmbedderTest {};
diff --git a/fpdfsdk/fpdf_view.cpp b/fpdfsdk/fpdf_view.cpp
index 161340b8a1..23e86e87a9 100644
--- a/fpdfsdk/fpdf_view.cpp
+++ b/fpdfsdk/fpdf_view.cpp
@@ -37,7 +37,7 @@
 #include "core/fxcrt/fx_system.h"
 #include "core/fxcrt/stl_util.h"
 #include "core/fxcrt/unowned_ptr.h"
-#include "core/fxge/cfx_defaultrenderdevice.h"
+//#include "core/fxge/cfx_defaultrenderdevice.h"
 #include "core/fxge/cfx_gemodule.h"
 #include "core/fxge/cfx_renderdevice.h"
 #include "fpdfsdk/cpdfsdk_customaccess.h"
@@ -498,109 +498,109 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPage(HDC dc,
                                                int size_y,
                                                int rotate,
                                                int flags) {
-  CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
-  if (!pPage)
-    return;
-
-  auto pOwnedContext = std::make_unique<CPDF_PageRenderContext>();
-  CPDF_PageRenderContext* pContext = pOwnedContext.get();
-  CPDF_Page::RenderContextClearer clearer(pPage);
-  pPage->SetRenderContext(std::move(pOwnedContext));
-
-  // Don't render the full page to bitmap for a mask unless there are a lot
-  // of masks. Full page bitmaps result in large spool sizes, so they should
-  // only be used when necessary. For large numbers of masks, rendering each
-  // individually is inefficient and unlikely to significantly improve spool
-  // size.
-  const bool bEnableImageMasks =
-      g_pdfium_print_mode == WindowsPrintMode::kEmfImageMasks;
-  const bool bNewBitmap = pPage->BackgroundAlphaNeeded() ||
-                          (pPage->HasImageMask() && !bEnableImageMasks) ||
-                          pPage->GetMaskBoundingBoxes().size() > 100;
-  const bool bHasMask = pPage->HasImageMask() && !bNewBitmap;
-  auto* render_data = CPDF_DocRenderData::FromDocument(pPage->GetDocument());
-  if (!bNewBitmap && !bHasMask) {
-    pContext->m_pDevice = std::make_unique<CPDF_WindowsRenderDevice>(
-        dc, render_data->GetPSFontTracker());
-    CPDFSDK_RenderPageWithContext(pContext, pPage, start_x, start_y, size_x,
-                                  size_y, rotate, flags,
-                                  /*color_scheme=*/nullptr,
-                                  /*need_to_restore=*/true, /*pause=*/nullptr);
-    return;
-  }
-
-  RetainPtr<CFX_DIBitmap> pBitmap = pdfium::MakeRetain<CFX_DIBitmap>();
-  // Create will probably work fine even if it fails here: we will just attach
-  // a zero-sized bitmap to |pDevice|.
-  pBitmap->Create(size_x, size_y, FXDIB_Format::kArgb);
-  pBitmap->Clear(0x00ffffff);
-  CFX_DefaultRenderDevice* pDevice = new CFX_DefaultRenderDevice;
-  pContext->m_pDevice = pdfium::WrapUnique(pDevice);
-  pDevice->Attach(pBitmap, false, nullptr, false);
-  if (bHasMask) {
-    pContext->m_pOptions = std::make_unique<CPDF_RenderOptions>();
-    pContext->m_pOptions->GetOptions().bBreakForMasks = true;
-  }
-
-  CPDFSDK_RenderPageWithContext(pContext, pPage, start_x, start_y, size_x,
-                                size_y, rotate, flags, /*color_scheme=*/nullptr,
-                                /*need_to_restore=*/true,
-                                /*pause=*/nullptr);
-
-  if (!bHasMask) {
-    CPDF_WindowsRenderDevice win_dc(dc, render_data->GetPSFontTracker());
-    bool bitsStretched = false;
-    if (win_dc.GetDeviceType() == DeviceType::kPrinter) {
-      auto pDst = pdfium::MakeRetain<CFX_DIBitmap>();
-      if (pDst->Create(size_x, size_y, FXDIB_Format::kRgb32)) {
-        memset(pDst->GetBuffer(), -1, pBitmap->GetPitch() * size_y);
-        pDst->CompositeBitmap(0, 0, size_x, size_y, pBitmap, 0, 0,
-                              BlendMode::kNormal, nullptr, false);
-        win_dc.StretchDIBits(pDst, 0, 0, size_x, size_y);
-        bitsStretched = true;
-      }
-    }
-    if (!bitsStretched)
-      win_dc.SetDIBits(pBitmap, 0, 0);
-    return;
-  }
-
-  // Finish rendering the page to bitmap and copy the correct segments
-  // of the page to individual image mask bitmaps.
-  const std::vector<CFX_FloatRect>& mask_boxes = pPage->GetMaskBoundingBoxes();
-  std::vector<FX_RECT> bitmap_areas(mask_boxes.size());
-  std::vector<RetainPtr<CFX_DIBitmap>> bitmaps(mask_boxes.size());
-  for (size_t i = 0; i < mask_boxes.size(); i++) {
-    bitmaps[i] = GetMaskBitmap(pPage, start_x, start_y, size_x, size_y, rotate,
-                               pBitmap, mask_boxes[i], &bitmap_areas[i]);
-    pContext->m_pRenderer->Continue(nullptr);
-  }
-
-  // Begin rendering to the printer. Add flag to indicate the renderer should
-  // pause after each image mask.
-  pPage->ClearRenderContext();
-  pOwnedContext = std::make_unique<CPDF_PageRenderContext>();
-  pContext = pOwnedContext.get();
-  pPage->SetRenderContext(std::move(pOwnedContext));
-  pContext->m_pDevice = std::make_unique<CPDF_WindowsRenderDevice>(
-      dc, render_data->GetPSFontTracker());
-  pContext->m_pOptions = std::make_unique<CPDF_RenderOptions>();
-  pContext->m_pOptions->GetOptions().bBreakForMasks = true;
-
-  CPDFSDK_RenderPageWithContext(pContext, pPage, start_x, start_y, size_x,
-                                size_y, rotate, flags, /*color_scheme=*/nullptr,
-                                /*need_to_restore=*/true,
-                                /*pause=*/nullptr);
-
-  // Render masks
-  for (size_t i = 0; i < mask_boxes.size(); i++) {
-    // Render the bitmap for the mask and free the bitmap.
-    if (bitmaps[i]) {  // will be null if mask has zero area
-      RenderBitmap(pContext->m_pDevice.get(), bitmaps[i], bitmap_areas[i]);
-    }
-    // Render the next portion of page.
-    pContext->m_pRenderer->Continue(nullptr);
-  }
+  //CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
+  //if (!pPage)
+  //  return;
+
+  //auto pOwnedContext = std::make_unique<CPDF_PageRenderContext>();
+  //CPDF_PageRenderContext* pContext = pOwnedContext.get();
+  //CPDF_Page::RenderContextClearer clearer(pPage);
+  //pPage->SetRenderContext(std::move(pOwnedContext));
+
+  //// Don't render the full page to bitmap for a mask unless there are a lot
+  //// of masks. Full page bitmaps result in large spool sizes, so they should
+  //// only be used when necessary. For large numbers of masks, rendering each
+  //// individually is inefficient and unlikely to significantly improve spool
+  //// size.
+  //const bool bEnableImageMasks =
+  //    g_pdfium_print_mode == WindowsPrintMode::kEmfImageMasks;
+  //const bool bNewBitmap = pPage->BackgroundAlphaNeeded() ||
+  //                        (pPage->HasImageMask() && !bEnableImageMasks) ||
+  //                        pPage->GetMaskBoundingBoxes().size() > 100;
+  //const bool bHasMask = pPage->HasImageMask() && !bNewBitmap;
+  //auto* render_data = CPDF_DocRenderData::FromDocument(pPage->GetDocument());
+  //if (!bNewBitmap && !bHasMask) {
+  //  pContext->m_pDevice = std::make_unique<CPDF_WindowsRenderDevice>(
+  //      dc, render_data->GetPSFontTracker());
+  //  CPDFSDK_RenderPageWithContext(pContext, pPage, start_x, start_y, size_x,
+  //                                size_y, rotate, flags,
+  //                                /*color_scheme=*/nullptr,
+  //                                /*need_to_restore=*/true, /*pause=*/nullptr);
+  //  return;
+  //}
+
+  //RetainPtr<CFX_DIBitmap> pBitmap = pdfium::MakeRetain<CFX_DIBitmap>();
+  //// Create will probably work fine even if it fails here: we will just attach
+  //// a zero-sized bitmap to |pDevice|.
+  //pBitmap->Create(size_x, size_y, FXDIB_Format::kArgb);
+  //pBitmap->Clear(0x00ffffff);
+  //CFX_DefaultRenderDevice* pDevice = new CFX_DefaultRenderDevice;
+  //pContext->m_pDevice = pdfium::WrapUnique(pDevice);
+  //pDevice->Attach(pBitmap, false, nullptr, false);
+  //if (bHasMask) {
+  //  pContext->m_pOptions = std::make_unique<CPDF_RenderOptions>();
+  //  pContext->m_pOptions->GetOptions().bBreakForMasks = true;
+  //}
+
+  //CPDFSDK_RenderPageWithContext(pContext, pPage, start_x, start_y, size_x,
+  //                              size_y, rotate, flags, /*color_scheme=*/nullptr,
+  //                              /*need_to_restore=*/true,
+  //                              /*pause=*/nullptr);
+
+  //if (!bHasMask) {
+  //  CPDF_WindowsRenderDevice win_dc(dc, render_data->GetPSFontTracker());
+  //  bool bitsStretched = false;
+  //  if (win_dc.GetDeviceType() == DeviceType::kPrinter) {
+  //    auto pDst = pdfium::MakeRetain<CFX_DIBitmap>();
+  //    if (pDst->Create(size_x, size_y, FXDIB_Format::kRgb32)) {
+  //      memset(pDst->GetBuffer(), -1, pBitmap->GetPitch() * size_y);
+  //      pDst->CompositeBitmap(0, 0, size_x, size_y, pBitmap, 0, 0,
+  //                            BlendMode::kNormal, nullptr, false);
+  //      win_dc.StretchDIBits(pDst, 0, 0, size_x, size_y);
+  //      bitsStretched = true;
+  //    }
+  //  }
+  //  if (!bitsStretched)
+  //    win_dc.SetDIBits(pBitmap, 0, 0);
+  //  return;
+  //}
+
+  //// Finish rendering the page to bitmap and copy the correct segments
+  //// of the page to individual image mask bitmaps.
+  //const std::vector<CFX_FloatRect>& mask_boxes = pPage->GetMaskBoundingBoxes();
+  //std::vector<FX_RECT> bitmap_areas(mask_boxes.size());
+  //std::vector<RetainPtr<CFX_DIBitmap>> bitmaps(mask_boxes.size());
+  //for (size_t i = 0; i < mask_boxes.size(); i++) {
+  //  bitmaps[i] = GetMaskBitmap(pPage, start_x, start_y, size_x, size_y, rotate,
+  //                             pBitmap, mask_boxes[i], &bitmap_areas[i]);
+  //  pContext->m_pRenderer->Continue(nullptr);
+  //}
+
+  //// Begin rendering to the printer. Add flag to indicate the renderer should
+  //// pause after each image mask.
+  //pPage->ClearRenderContext();
+  //pOwnedContext = std::make_unique<CPDF_PageRenderContext>();
+  //pContext = pOwnedContext.get();
+  //pPage->SetRenderContext(std::move(pOwnedContext));
+  //pContext->m_pDevice = std::make_unique<CPDF_WindowsRenderDevice>(
+  //    dc, render_data->GetPSFontTracker());
+  //pContext->m_pOptions = std::make_unique<CPDF_RenderOptions>();
+  //pContext->m_pOptions->GetOptions().bBreakForMasks = true;
+
+  //CPDFSDK_RenderPageWithContext(pContext, pPage, start_x, start_y, size_x,
+  //                              size_y, rotate, flags, /*color_scheme=*/nullptr,
+  //                              /*need_to_restore=*/true,
+  //                              /*pause=*/nullptr);
+
+  //// Render masks
+  //for (size_t i = 0; i < mask_boxes.size(); i++) {
+  //  // Render the bitmap for the mask and free the bitmap.
+  //  if (bitmaps[i]) {  // will be null if mask has zero area
+  //    RenderBitmap(pContext->m_pDevice.get(), bitmaps[i], bitmap_areas[i]);
+  //  }
+  //  // Render the next portion of page.
+  //  pContext->m_pRenderer->Continue(nullptr);
+  //}
 }
 #endif  // BUILDFLAG(IS_WIN)
 
@@ -612,33 +612,33 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPageBitmap(FPDF_BITMAP bitmap,
                                                      int size_y,
                                                      int rotate,
                                                      int flags) {
-  if (!bitmap)
-    return;
-
-  CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
-  if (!pPage)
-    return;
-
-  auto pOwnedContext = std::make_unique<CPDF_PageRenderContext>();
-  CPDF_PageRenderContext* pContext = pOwnedContext.get();
-  CPDF_Page::RenderContextClearer clearer(pPage);
-  pPage->SetRenderContext(std::move(pOwnedContext));
-
-  auto pOwnedDevice = std::make_unique<CFX_DefaultRenderDevice>();
-  CFX_DefaultRenderDevice* pDevice = pOwnedDevice.get();
-  pContext->m_pDevice = std::move(pOwnedDevice);
-
-  RetainPtr<CFX_DIBitmap> pBitmap(CFXDIBitmapFromFPDFBitmap(bitmap));
-  pDevice->Attach(pBitmap, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false);
-  CPDFSDK_RenderPageWithContext(pContext, pPage, start_x, start_y, size_x,
-                                size_y, rotate, flags, /*color_scheme=*/nullptr,
-                                /*need_to_restore=*/true,
-                                /*pause=*/nullptr);
-
-#if defined(_SKIA_SUPPORT_PATHS_)
-  pDevice->Flush(true);
-  pBitmap->UnPreMultiply();
-#endif
+//  if (!bitmap)
+//    return;
+//
+//  CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
+//  if (!pPage)
+//    return;
+//
+//  auto pOwnedContext = std::make_unique<CPDF_PageRenderContext>();
+//  CPDF_PageRenderContext* pContext = pOwnedContext.get();
+//  CPDF_Page::RenderContextClearer clearer(pPage);
+//  pPage->SetRenderContext(std::move(pOwnedContext));
+//
+//  auto pOwnedDevice = std::make_unique<CFX_DefaultRenderDevice>();
+//  CFX_DefaultRenderDevice* pDevice = pOwnedDevice.get();
+//  pContext->m_pDevice = std::move(pOwnedDevice);
+//
+//  RetainPtr<CFX_DIBitmap> pBitmap(CFXDIBitmapFromFPDFBitmap(bitmap));
+//  pDevice->Attach(pBitmap, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false);
+//  CPDFSDK_RenderPageWithContext(pContext, pPage, start_x, start_y, size_x,
+//                                size_y, rotate, flags, /*color_scheme=*/nullptr,
+//                                /*need_to_restore=*/true,
+//                                /*pause=*/nullptr);
+//
+//#if defined(_SKIA_SUPPORT_PATHS_)
+//  pDevice->Flush(true);
+//  pBitmap->UnPreMultiply();
+//#endif
 }
 
 FPDF_EXPORT void FPDF_CALLCONV
@@ -647,60 +647,60 @@ FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap,
                                 const FS_MATRIX* matrix,
                                 const FS_RECTF* clipping,
                                 int flags) {
-  if (!bitmap)
-    return;
+  //if (!bitmap)
+  //  return;
 
-  CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
-  if (!pPage)
-    return;
+  //CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
+  //if (!pPage)
+  //  return;
 
-  auto pOwnedContext = std::make_unique<CPDF_PageRenderContext>();
-  CPDF_PageRenderContext* pContext = pOwnedContext.get();
-  CPDF_Page::RenderContextClearer clearer(pPage);
-  pPage->SetRenderContext(std::move(pOwnedContext));
+  //auto pOwnedContext = std::make_unique<CPDF_PageRenderContext>();
+  //CPDF_PageRenderContext* pContext = pOwnedContext.get();
+  //CPDF_Page::RenderContextClearer clearer(pPage);
+  //pPage->SetRenderContext(std::move(pOwnedContext));
 
-  auto pOwnedDevice = std::make_unique<CFX_DefaultRenderDevice>();
-  CFX_DefaultRenderDevice* pDevice = pOwnedDevice.get();
-  pContext->m_pDevice = std::move(pOwnedDevice);
+  //auto pOwnedDevice = std::make_unique<CFX_DefaultRenderDevice>();
+  //CFX_DefaultRenderDevice* pDevice = pOwnedDevice.get();
+  //pContext->m_pDevice = std::move(pOwnedDevice);
 
-  RetainPtr<CFX_DIBitmap> pBitmap(CFXDIBitmapFromFPDFBitmap(bitmap));
-  pDevice->Attach(pBitmap, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false);
+  //RetainPtr<CFX_DIBitmap> pBitmap(CFXDIBitmapFromFPDFBitmap(bitmap));
+  //pDevice->Attach(pBitmap, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false);
 
-  CFX_FloatRect clipping_rect;
-  if (clipping)
-    clipping_rect = CFXFloatRectFromFSRectF(*clipping);
-  FX_RECT clip_rect = clipping_rect.ToFxRect();
+  //CFX_FloatRect clipping_rect;
+  //if (clipping)
+  //  clipping_rect = CFXFloatRectFromFSRectF(*clipping);
+  //FX_RECT clip_rect = clipping_rect.ToFxRect();
 
-  const FX_RECT rect(0, 0, pPage->GetPageWidth(), pPage->GetPageHeight());
-  CFX_Matrix transform_matrix = pPage->GetDisplayMatrix(rect, 0);
-  if (matrix)
-    transform_matrix *= CFXMatrixFromFSMatrix(*matrix);
-  CPDFSDK_RenderPage(pContext, pPage, transform_matrix, clip_rect, flags,
-                     /*color_scheme=*/nullptr);
+  //const FX_RECT rect(0, 0, pPage->GetPageWidth(), pPage->GetPageHeight());
+  //CFX_Matrix transform_matrix = pPage->GetDisplayMatrix(rect, 0);
+  //if (matrix)
+  //  transform_matrix *= CFXMatrixFromFSMatrix(*matrix);
+  //CPDFSDK_RenderPage(pContext, pPage, transform_matrix, clip_rect, flags,
+  //                   /*color_scheme=*/nullptr);
 }
 
 #if defined(_SKIA_SUPPORT_)
 FPDF_EXPORT FPDF_RECORDER FPDF_CALLCONV FPDF_RenderPageSkp(FPDF_PAGE page,
                                                            int size_x,
                                                            int size_y) {
-  CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
-  if (!pPage)
+  //CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
+  //if (!pPage)
     return nullptr;
 
-  auto pOwnedContext = std::make_unique<CPDF_PageRenderContext>();
-  CPDF_PageRenderContext* pContext = pOwnedContext.get();
-  CPDF_Page::RenderContextClearer clearer(pPage);
-  pPage->SetRenderContext(std::move(pOwnedContext));
+  //auto pOwnedContext = std::make_unique<CPDF_PageRenderContext>();
+  //CPDF_PageRenderContext* pContext = pOwnedContext.get();
+  //CPDF_Page::RenderContextClearer clearer(pPage);
+  //pPage->SetRenderContext(std::move(pOwnedContext));
 
-  auto skDevice = std::make_unique<CFX_DefaultRenderDevice>();
-  FPDF_RECORDER recorder = skDevice->CreateRecorder(size_x, size_y);
-  pContext->m_pDevice = std::move(skDevice);
+  //auto skDevice = std::make_unique<CFX_DefaultRenderDevice>();
+  //FPDF_RECORDER recorder = skDevice->CreateRecorder(size_x, size_y);
+  //pContext->m_pDevice = std::move(skDevice);
 
-  CPDFSDK_RenderPageWithContext(pContext, pPage, 0, 0, size_x, size_y, 0, 0,
-                                /*color_scheme=*/nullptr,
-                                /*need_to_restore=*/true, /*pause=*/nullptr);
+  //CPDFSDK_RenderPageWithContext(pContext, pPage, 0, 0, size_x, size_y, 0, 0,
+  //                              /*color_scheme=*/nullptr,
+  //                              /*need_to_restore=*/true, /*pause=*/nullptr);
 
-  return recorder;
+  //return recorder;
 }
 #endif  // defined(_SKIA_SUPPORT_)
 
@@ -860,16 +860,16 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFBitmap_FillRect(FPDF_BITMAP bitmap,
                                                    int width,
                                                    int height,
                                                    FPDF_DWORD color) {
-  if (!bitmap)
-    return;
-
-  CFX_DefaultRenderDevice device;
-  RetainPtr<CFX_DIBitmap> pBitmap(CFXDIBitmapFromFPDFBitmap(bitmap));
-  device.Attach(pBitmap, false, nullptr, false);
-  if (!pBitmap->IsAlphaFormat())
-    color |= 0xFF000000;
-  device.FillRect(FX_RECT(left, top, left + width, top + height),
-                  static_cast<uint32_t>(color));
+  //if (!bitmap)
+  //  return;
+
+  //CFX_DefaultRenderDevice device;
+  //RetainPtr<CFX_DIBitmap> pBitmap(CFXDIBitmapFromFPDFBitmap(bitmap));
+  //device.Attach(pBitmap, false, nullptr, false);
+  //if (!pBitmap->IsAlphaFormat())
+  //  color |= 0xFF000000;
+  //device.FillRect(FX_RECT(left, top, left + width, top + height),
+  //                static_cast<uint32_t>(color));
 }
 
 FPDF_EXPORT void* FPDF_CALLCONV FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap) {
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_page.h b/fpdfsdk/fpdfxfa/cpdfxfa_page.h
index 5b22946a10..905957eb66 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_page.h
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_page.h
@@ -12,7 +12,7 @@
 #include "core/fxcrt/fx_coordinates.h"
 #include "core/fxcrt/retain_ptr.h"
 #include "core/fxcrt/unowned_ptr.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CFX_RenderDevice;
 class CPDF_Dictionary;
diff --git a/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h b/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h
index eafafce1e4..0ec57d79ee 100644
--- a/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h
+++ b/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h
@@ -9,7 +9,7 @@
 
 #include <memory>
 
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CBC_ReedSolomonGF256Poly;
 
diff --git a/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp b/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp
index c2f4a9db35..b4e416cae0 100644
--- a/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp
+++ b/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp
@@ -27,7 +27,7 @@
 #include "fxbarcode/datamatrix/BC_EncoderContext.h"
 #include "fxbarcode/datamatrix/BC_HighLevelEncoder.h"
 #include "fxbarcode/datamatrix/BC_SymbolInfo.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 namespace {
 
diff --git a/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h b/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h
index 5a42fee436..adebf41018 100644
--- a/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h
+++ b/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h
@@ -10,7 +10,7 @@
 #include <stdint.h>
 
 #include "core/fxcrt/widestring.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CBC_PDF417ErrorCorrection {
  public:
diff --git a/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h b/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h
index c992ab18ca..c402f89111 100644
--- a/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h
+++ b/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h
@@ -9,7 +9,7 @@
 
 #include "core/fxcrt/widestring.h"
 #include "fxbarcode/pdf417/BC_PDF417.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/span.h"
 
 class CBC_PDF417HighLevelEncoder {
diff --git a/fxbarcode/qrcode/BC_QRCoderEncoder.cpp b/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
index 727b36bd23..b676959d51 100644
--- a/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
+++ b/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
@@ -39,7 +39,7 @@
 #include "fxbarcode/qrcode/BC_QRCoderMatrixUtil.h"
 #include "fxbarcode/qrcode/BC_QRCoderMode.h"
 #include "fxbarcode/qrcode/BC_QRCoderVersion.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/check.h"
 #include "third_party/base/check_op.h"
 #include "third_party/base/cxx17_backports.h"
diff --git a/fxjs/cfx_globaldata.h b/fxjs/cfx_globaldata.h
index 86ce5c7cab..4adf15a523 100644
--- a/fxjs/cfx_globaldata.h
+++ b/fxjs/cfx_globaldata.h
@@ -13,7 +13,7 @@
 #include "core/fxcrt/cfx_binarybuf.h"
 #include "core/fxcrt/unowned_ptr.h"
 #include "fxjs/cfx_keyvalue.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/span.h"
 
 class CFX_GlobalData {
diff --git a/fxjs/cjs_field.cpp b/fxjs/cjs_field.cpp
index a515ccf6a7..e889e27f40 100644
--- a/fxjs/cjs_field.cpp
+++ b/fxjs/cjs_field.cpp
@@ -27,7 +27,7 @@
 #include "fxjs/cjs_icon.h"
 #include "fxjs/fxv8.h"
 #include "fxjs/js_resources.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/check.h"
 #include "third_party/base/notreached.h"
 #include "v8/include/v8-container.h"
diff --git a/fxjs/cjs_publicmethods.cpp b/fxjs/cjs_publicmethods.cpp
index 503d868838..78c954cc4d 100644
--- a/fxjs/cjs_publicmethods.cpp
+++ b/fxjs/cjs_publicmethods.cpp
@@ -34,7 +34,7 @@
 #include "fxjs/fx_date_helpers.h"
 #include "fxjs/js_define.h"
 #include "fxjs/js_resources.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/check.h"
 #include "third_party/base/cxx17_backports.h"
 #include "third_party/base/numerics/safe_conversions.h"
diff --git a/fxjs/cjs_result.h b/fxjs/cjs_result.h
index d2265ac8e2..db88e0fdde 100644
--- a/fxjs/cjs_result.h
+++ b/fxjs/cjs_result.h
@@ -8,7 +8,7 @@
 #define FXJS_CJS_RESULT_H_
 
 #include "fxjs/js_resources.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "v8/include/v8-forward.h"
 
 class CJS_Result {
diff --git a/fxjs/ijs_event_context.h b/fxjs/ijs_event_context.h
index 153a5d9d68..e162a7bc31 100644
--- a/fxjs/ijs_event_context.h
+++ b/fxjs/ijs_event_context.h
@@ -9,7 +9,7 @@
 
 #include "core/fxcrt/widestring.h"
 #include "fxjs/ijs_runtime.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CPDF_FormField;
 
diff --git a/fxjs/ijs_runtime.h b/fxjs/ijs_runtime.h
index 2bc1ca299d..4db1977e73 100644
--- a/fxjs/ijs_runtime.h
+++ b/fxjs/ijs_runtime.h
@@ -12,7 +12,7 @@
 #include "core/fxcrt/fx_memory.h"
 #include "core/fxcrt/unowned_ptr.h"
 #include "core/fxcrt/widestring.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CJS_Runtime;
 class CPDFSDK_FormFillEnvironment;
diff --git a/fxjs/xfa/cfxjse_formcalc_context.cpp b/fxjs/xfa/cfxjse_formcalc_context.cpp
index a18bbe00ac..51785a1f08 100644
--- a/fxjs/xfa/cfxjse_formcalc_context.cpp
+++ b/fxjs/xfa/cfxjse_formcalc_context.cpp
@@ -28,7 +28,7 @@
 #include "fxjs/xfa/cfxjse_engine.h"
 #include "fxjs/xfa/cfxjse_value.h"
 #include "fxjs/xfa/cjx_object.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/check_op.h"
 #include "third_party/base/cxx17_backports.h"
 #include "third_party/base/numerics/safe_conversions.h"
diff --git a/fxjs/xfa/cfxjse_formcalc_context.h b/fxjs/xfa/cfxjse_formcalc_context.h
index 611276e531..f7a5358351 100644
--- a/fxjs/xfa/cfxjse_formcalc_context.h
+++ b/fxjs/xfa/cfxjse_formcalc_context.h
@@ -13,7 +13,7 @@
 
 #include "core/fxcrt/unowned_ptr.h"
 #include "fxjs/xfa/fxjse.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "v8/include/v8-forward.h"
 #include "v8/include/v8-persistent-handle.h"
 
diff --git a/fxjs/xfa/cfxjse_mapmodule.h b/fxjs/xfa/cfxjse_mapmodule.h
index 5ab182ec78..be6482b1fb 100644
--- a/fxjs/xfa/cfxjse_mapmodule.h
+++ b/fxjs/xfa/cfxjse_mapmodule.h
@@ -12,7 +12,7 @@
 #include <map>
 
 #include "core/fxcrt/widestring.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CXFA_Measurement;
 
diff --git a/fxjs/xfa/cfxjse_mapmodule_unittest.cpp b/fxjs/xfa/cfxjse_mapmodule_unittest.cpp
index ba74bb6b5b..bddefd23a8 100644
--- a/fxjs/xfa/cfxjse_mapmodule_unittest.cpp
+++ b/fxjs/xfa/cfxjse_mapmodule_unittest.cpp
@@ -8,7 +8,7 @@
 
 #include "core/fxcrt/fx_string.h"
 #include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "xfa/fxfa/parser/cxfa_measurement.h"
 
 TEST(CFXJSEMapModule, EmptyModule) {
diff --git a/fxjs/xfa/cjx_object.h b/fxjs/xfa/cjx_object.h
index 7bc5e838ac..944d1bc8bb 100644
--- a/fxjs/xfa/cjx_object.h
+++ b/fxjs/xfa/cjx_object.h
@@ -16,7 +16,7 @@
 #include "fxjs/gc/heap.h"
 #include "fxjs/xfa/fxjse.h"
 #include "fxjs/xfa/jse_define.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/span.h"
 #include "v8/include/cppgc/garbage-collected.h"
 #include "v8/include/cppgc/member.h"
diff --git a/testing/scoped_set_tz.h b/testing/scoped_set_tz.h
index 4783a57f31..e7a0195a52 100644
--- a/testing/scoped_set_tz.h
+++ b/testing/scoped_set_tz.h
@@ -8,7 +8,7 @@
 #include <string>
 
 #include "core/fxcrt/fx_memory.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class ScopedSetTZ {
  public:
diff --git a/xfa/fgas/font/cfgas_gefont.h b/xfa/fgas/font/cfgas_gefont.h
index 933696078b..cfcbaa9bd7 100644
--- a/xfa/fgas/font/cfgas_gefont.h
+++ b/xfa/fgas/font/cfgas_gefont.h
@@ -20,7 +20,7 @@
 #include "core/fxcrt/fx_string.h"
 #include "core/fxcrt/maybe_owned.h"
 #include "core/fxcrt/retain_ptr.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CFX_Font;
 class CFX_UnicodeEncodingEx;
diff --git a/xfa/fgas/layout/fgas_arabic.h b/xfa/fgas/layout/fgas_arabic.h
index a865330fcd..6847d1215e 100644
--- a/xfa/fgas/layout/fgas_arabic.h
+++ b/xfa/fgas/layout/fgas_arabic.h
@@ -7,7 +7,7 @@
 #ifndef XFA_FGAS_LAYOUT_FGAS_ARABIC_H_
 #define XFA_FGAS_LAYOUT_FGAS_ARABIC_H_
 
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 
 class CFGAS_Char;
 
diff --git a/xfa/fwl/cfwl_barcode.h b/xfa/fwl/cfwl_barcode.h
index 23266a900e..e8650f666d 100644
--- a/xfa/fwl/cfwl_barcode.h
+++ b/xfa/fwl/cfwl_barcode.h
@@ -12,7 +12,7 @@
 #include <memory>
 
 #include "fxbarcode/BC_Library.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "xfa/fwl/cfwl_edit.h"
 
 class CFX_Barcode;
diff --git a/xfa/fxfa/cxfa_textparser.h b/xfa/fxfa/cxfa_textparser.h
index 90dedb6b42..29cc783940 100644
--- a/xfa/fxfa/cxfa_textparser.h
+++ b/xfa/fxfa/cxfa_textparser.h
@@ -19,7 +19,7 @@
 #include "core/fxcrt/widestring.h"
 #include "core/fxge/dib/fx_dib.h"
 #include "fxjs/gc/heap.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "v8/include/cppgc/garbage-collected.h"
 #include "xfa/fxfa/fxfa_basic.h"
 
diff --git a/xfa/fxfa/cxfa_textprovider.h b/xfa/fxfa/cxfa_textprovider.h
index 916eed84d0..2ac65b7880 100644
--- a/xfa/fxfa/cxfa_textprovider.h
+++ b/xfa/fxfa/cxfa_textprovider.h
@@ -9,7 +9,7 @@
 
 #include "core/fxcrt/widestring.h"
 #include "fxjs/gc/heap.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "v8/include/cppgc/garbage-collected.h"
 #include "v8/include/cppgc/member.h"
 #include "v8/include/cppgc/visitor.h"
diff --git a/xfa/fxfa/formcalc/cxfa_fmexpression.h b/xfa/fxfa/formcalc/cxfa_fmexpression.h
index 13ed680e78..3b8ae8a707 100644
--- a/xfa/fxfa/formcalc/cxfa_fmexpression.h
+++ b/xfa/fxfa/formcalc/cxfa_fmexpression.h
@@ -11,7 +11,7 @@
 
 #include "core/fxcrt/widestring.h"
 #include "fxjs/gc/heap.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "v8/include/cppgc/garbage-collected.h"
 #include "v8/include/cppgc/member.h"
 #include "xfa/fxfa/formcalc/cxfa_fmlexer.h"
diff --git a/xfa/fxfa/formcalc/cxfa_fmparser.h b/xfa/fxfa/formcalc/cxfa_fmparser.h
index b23a63822b..5fd42347b0 100644
--- a/xfa/fxfa/formcalc/cxfa_fmparser.h
+++ b/xfa/fxfa/formcalc/cxfa_fmparser.h
@@ -11,7 +11,7 @@
 
 #include "core/fxcrt/unowned_ptr.h"
 #include "fxjs/gc/heap.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "v8/include/cppgc/macros.h"
 #include "v8/include/cppgc/member.h"
 #include "xfa/fxfa/formcalc/cxfa_fmexpression.h"
diff --git a/xfa/fxfa/layout/cxfa_contentlayoutprocessor.h b/xfa/fxfa/layout/cxfa_contentlayoutprocessor.h
index 51fa4e3417..14fbb8270c 100644
--- a/xfa/fxfa/layout/cxfa_contentlayoutprocessor.h
+++ b/xfa/fxfa/layout/cxfa_contentlayoutprocessor.h
@@ -17,7 +17,7 @@
 #include "core/fxcrt/fx_coordinates.h"
 #include "core/fxcrt/unowned_ptr.h"
 #include "fxjs/gc/heap.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "v8/include/cppgc/garbage-collected.h"
 #include "v8/include/cppgc/macros.h"
 #include "v8/include/cppgc/member.h"
diff --git a/xfa/fxfa/layout/cxfa_viewlayoutprocessor.h b/xfa/fxfa/layout/cxfa_viewlayoutprocessor.h
index 41d14ae291..d8d0fdb307 100644
--- a/xfa/fxfa/layout/cxfa_viewlayoutprocessor.h
+++ b/xfa/fxfa/layout/cxfa_viewlayoutprocessor.h
@@ -14,7 +14,7 @@
 
 #include "core/fxcrt/unowned_ptr.h"
 #include "fxjs/gc/heap.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "v8/include/cppgc/garbage-collected.h"
 #include "v8/include/cppgc/member.h"
 #include "v8/include/cppgc/prefinalizer.h"
diff --git a/xfa/fxfa/parser/cxfa_barcode.h b/xfa/fxfa/parser/cxfa_barcode.h
index d0f7e1672c..d5a6cccf39 100644
--- a/xfa/fxfa/parser/cxfa_barcode.h
+++ b/xfa/fxfa/parser/cxfa_barcode.h
@@ -7,7 +7,7 @@
 #ifndef XFA_FXFA_PARSER_CXFA_BARCODE_H_
 #define XFA_FXFA_PARSER_CXFA_BARCODE_H_
 
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
 
 class CXFA_Barcode final : public CXFA_Node {
diff --git a/xfa/fxfa/parser/cxfa_document.h b/xfa/fxfa/parser/cxfa_document.h
index 6432dd1667..31c856a5af 100644
--- a/xfa/fxfa/parser/cxfa_document.h
+++ b/xfa/fxfa/parser/cxfa_document.h
@@ -17,7 +17,7 @@
 #include "core/fxcrt/unowned_ptr.h"
 #include "core/fxcrt/widestring.h"
 #include "fxjs/gc/heap.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/span.h"
 #include "v8/include/cppgc/garbage-collected.h"
 #include "v8/include/cppgc/member.h"
diff --git a/xfa/fxfa/parser/cxfa_document_builder.cpp b/xfa/fxfa/parser/cxfa_document_builder.cpp
index 02226e7f96..99a5c8e109 100644
--- a/xfa/fxfa/parser/cxfa_document_builder.cpp
+++ b/xfa/fxfa/parser/cxfa_document_builder.cpp
@@ -20,7 +20,7 @@
 #include "core/fxcrt/xml/cfx_xmlnode.h"
 #include "core/fxcrt/xml/cfx_xmltext.h"
 #include "fxjs/xfa/cjx_object.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/check.h"
 #include "third_party/base/notreached.h"
 #include "xfa/fxfa/parser/cxfa_document.h"
diff --git a/xfa/fxfa/parser/cxfa_localemgr.h b/xfa/fxfa/parser/cxfa_localemgr.h
index 051bfe4afb..8e305d1dae 100644
--- a/xfa/fxfa/parser/cxfa_localemgr.h
+++ b/xfa/fxfa/parser/cxfa_localemgr.h
@@ -12,7 +12,7 @@
 #include "core/fxcrt/unowned_ptr.h"
 #include "core/fxcrt/widestring.h"
 #include "fxjs/gc/heap.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "v8/include/cppgc/garbage-collected.h"
 #include "v8/include/cppgc/member.h"
 #include "xfa/fgas/crt/locale_mgr_iface.h"
diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h
index e42f29f645..a425f4b26a 100644
--- a/xfa/fxfa/parser/cxfa_node.h
+++ b/xfa/fxfa/parser/cxfa_node.h
@@ -20,7 +20,7 @@
 #include "core/fxcrt/widestring.h"
 #include "core/fxge/dib/fx_dib.h"
 #include "fxjs/gc/gced_tree_node_mixin.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "third_party/base/span.h"
 #include "v8/include/cppgc/member.h"
 #include "v8/include/cppgc/visitor.h"
diff --git a/xfa/fxfa/parser/xfa_basic_data.h b/xfa/fxfa/parser/xfa_basic_data.h
index e131c17993..7b3d283c08 100644
--- a/xfa/fxfa/parser/xfa_basic_data.h
+++ b/xfa/fxfa/parser/xfa_basic_data.h
@@ -11,7 +11,7 @@
 
 #include "core/fxcrt/widestring.h"
 #include "fxjs/xfa/cjx_object.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "absl/types/optional.h"
 #include "xfa/fxfa/fxfa_basic.h"
 
 using XFA_ATTRIBUTE_CALLBACK = void (*)(v8::Isolate* pIsolate,