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

Side by Side Diff: core/fxge/agg/fx_agg_driver.cpp

Issue 2287313004: Make CPDF_TextState have a CPDF_TextStateData rather than inheriting one. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@moar_better_constness
Patch Set: Casts, Casts, New -> Emplace. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fxcrt/include/cfx_count_ref.h ('k') | core/fxge/ge/cfx_cliprgn.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fxge/agg/fx_agg_driver.h" 7 #include "core/fxge/agg/fx_agg_driver.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 m_pClipRgn = std::move(m_StateStack.back()); 521 m_pClipRgn = std::move(m_StateStack.back());
522 m_StateStack.pop_back(); 522 m_StateStack.pop_back();
523 } 523 }
524 } 524 }
525 525
526 void CFX_AggDeviceDriver::SetClipMask(agg::rasterizer_scanline_aa& rasterizer) { 526 void CFX_AggDeviceDriver::SetClipMask(agg::rasterizer_scanline_aa& rasterizer) {
527 FX_RECT path_rect(rasterizer.min_x(), rasterizer.min_y(), 527 FX_RECT path_rect(rasterizer.min_x(), rasterizer.min_y(),
528 rasterizer.max_x() + 1, rasterizer.max_y() + 1); 528 rasterizer.max_x() + 1, rasterizer.max_y() + 1);
529 path_rect.Intersect(m_pClipRgn->GetBox()); 529 path_rect.Intersect(m_pClipRgn->GetBox());
530 CFX_DIBitmapRef mask; 530 CFX_DIBitmapRef mask;
531 CFX_DIBitmap* pThisLayer = mask.New(); 531 CFX_DIBitmap* pThisLayer = mask.Emplace();
532 if (!pThisLayer) {
533 return;
534 }
535 pThisLayer->Create(path_rect.Width(), path_rect.Height(), FXDIB_8bppMask); 532 pThisLayer->Create(path_rect.Width(), path_rect.Height(), FXDIB_8bppMask);
536 pThisLayer->Clear(0); 533 pThisLayer->Clear(0);
537 agg::rendering_buffer raw_buf(pThisLayer->GetBuffer(), pThisLayer->GetWidth(), 534 agg::rendering_buffer raw_buf(pThisLayer->GetBuffer(), pThisLayer->GetWidth(),
538 pThisLayer->GetHeight(), 535 pThisLayer->GetHeight(),
539 pThisLayer->GetPitch()); 536 pThisLayer->GetPitch());
540 agg::pixfmt_gray8 pixel_buf(raw_buf); 537 agg::pixfmt_gray8 pixel_buf(raw_buf);
541 agg::renderer_base<agg::pixfmt_gray8> base_buf(pixel_buf); 538 agg::renderer_base<agg::pixfmt_gray8> base_buf(pixel_buf);
542 agg::renderer_scanline_aa_offset<agg::renderer_base<agg::pixfmt_gray8> > 539 agg::renderer_scanline_aa_offset<agg::renderer_base<agg::pixfmt_gray8> >
543 final_render(base_buf, path_rect.left, path_rect.top); 540 final_render(base_buf, path_rect.left, path_rect.top);
544 final_render.color(agg::gray8(255)); 541 final_render.color(agg::gray8(255));
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1764 WrapUnique(new CFX_AggDeviceDriver(pBitmap, FALSE, pOriDevice, FALSE))); 1761 WrapUnique(new CFX_AggDeviceDriver(pBitmap, FALSE, pOriDevice, FALSE)));
1765 return true; 1762 return true;
1766 } 1763 }
1767 1764
1768 CFX_FxgeDevice::~CFX_FxgeDevice() { 1765 CFX_FxgeDevice::~CFX_FxgeDevice() {
1769 if (m_bOwnedBitmap) { 1766 if (m_bOwnedBitmap) {
1770 delete GetBitmap(); 1767 delete GetBitmap();
1771 } 1768 }
1772 } 1769 }
1773 #endif 1770 #endif
OLDNEW
« no previous file with comments | « core/fxcrt/include/cfx_count_ref.h ('k') | core/fxge/ge/cfx_cliprgn.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698