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

Side by Side Diff: core/fxge/ge/cfx_renderdevice.cpp

Issue 2546803003: re-enable skia caching (Closed)
Patch Set: remove nullptr Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fxge/cfx_renderdevice.h ('k') | core/fxge/ifx_renderdevicedriver.h » ('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 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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/cfx_renderdevice.h" 7 #include "core/fxge/cfx_renderdevice.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } // namespace 347 } // namespace
348 348
349 CFX_RenderDevice::CFX_RenderDevice() 349 CFX_RenderDevice::CFX_RenderDevice()
350 : m_pBitmap(nullptr), 350 : m_pBitmap(nullptr),
351 m_Width(0), 351 m_Width(0),
352 m_Height(0), 352 m_Height(0),
353 m_bpp(0), 353 m_bpp(0),
354 m_RenderCaps(0), 354 m_RenderCaps(0),
355 m_DeviceClass(0) {} 355 m_DeviceClass(0) {}
356 356
357 CFX_RenderDevice::~CFX_RenderDevice() {} 357 CFX_RenderDevice::~CFX_RenderDevice() {
358 #if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_
359 Flush();
360 #endif
361 }
358 362
359 #ifdef _SKIA_SUPPORT_ 363 #if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_
360 void CFX_RenderDevice::Flush() { 364 void CFX_RenderDevice::Flush() {
361 m_pDeviceDriver.reset(); 365 m_pDeviceDriver.reset();
362 } 366 }
363 #endif 367 #endif
364 368
365 void CFX_RenderDevice::SetDeviceDriver( 369 void CFX_RenderDevice::SetDeviceDriver(
366 std::unique_ptr<IFX_RenderDeviceDriver> pDriver) { 370 std::unique_ptr<IFX_RenderDeviceDriver> pDriver) {
367 m_pDeviceDriver = std::move(pDriver); 371 m_pDeviceDriver = std::move(pDriver);
368 InitDeviceInfo(); 372 InitDeviceInfo();
369 } 373 }
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 CFX_Matrix matrix; 612 CFX_Matrix matrix;
609 if (pObject2Device) 613 if (pObject2Device)
610 matrix = *pObject2Device; 614 matrix = *pObject2Device;
611 matrix.TranslateI(-rect.left, -rect.top); 615 matrix.TranslateI(-rect.left, -rect.top);
612 matrix.Concat(fScaleX, 0, 0, fScaleY, 0, 0); 616 matrix.Concat(fScaleX, 0, 0, fScaleY, 0, 0);
613 if (!bitmap_device.GetDeviceDriver()->DrawPath( 617 if (!bitmap_device.GetDeviceDriver()->DrawPath(
614 pPathData, &matrix, pGraphState, fill_color, stroke_color, fill_mode, 618 pPathData, &matrix, pGraphState, fill_color, stroke_color, fill_mode,
615 blend_type)) { 619 blend_type)) {
616 return false; 620 return false;
617 } 621 }
622 #if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_
623 bitmap_device.GetDeviceDriver()->Flush();
624 #endif
618 FX_RECT src_rect(0, 0, FXSYS_round(rect.Width() * fScaleX), 625 FX_RECT src_rect(0, 0, FXSYS_round(rect.Width() * fScaleX),
619 FXSYS_round(rect.Height() * fScaleY)); 626 FXSYS_round(rect.Height() * fScaleY));
620 return m_pDeviceDriver->SetDIBits(&bitmap, 0, &src_rect, rect.left, rect.top, 627 return m_pDeviceDriver->SetDIBits(&bitmap, 0, &src_rect, rect.left, rect.top,
621 FXDIB_BLEND_NORMAL); 628 FXDIB_BLEND_NORMAL);
622 } 629 }
623 630
624 bool CFX_RenderDevice::SetPixel(int x, int y, uint32_t color) { 631 bool CFX_RenderDevice::SetPixel(int x, int y, uint32_t color) {
625 if (m_pDeviceDriver->SetPixel(x, y, color)) 632 if (m_pDeviceDriver->SetPixel(x, y, color))
626 return true; 633 return true;
627 634
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 fill_color, stroke_color, fill_mode, 1079 fill_color, stroke_color, fill_mode,
1073 FXDIB_BLEND_NORMAL)) { 1080 FXDIB_BLEND_NORMAL)) {
1074 return false; 1081 return false;
1075 } 1082 }
1076 } 1083 }
1077 if (pClippingPath) 1084 if (pClippingPath)
1078 pClippingPath->Append(&TransformedPath, pUser2Device); 1085 pClippingPath->Append(&TransformedPath, pUser2Device);
1079 } 1086 }
1080 return true; 1087 return true;
1081 } 1088 }
OLDNEW
« no previous file with comments | « core/fxge/cfx_renderdevice.h ('k') | core/fxge/ifx_renderdevicedriver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698