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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 2588123002: Fix ODR violation in Blink (Closed)
Patch Set: 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 | « no previous file | third_party/WebKit/Source/platform/graphics/ImageBuffer.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 /* 1 /*
2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 // Allocating too many GPU resources can makes us run into the driver's 843 // Allocating too many GPU resources can makes us run into the driver's
844 // resource limits. So we need to keep the number of texture resources 844 // resource limits. So we need to keep the number of texture resources
845 // under tight control 845 // under tight control
846 if (ImageBuffer::getGlobalAcceleratedImageBufferCount() >= 846 if (ImageBuffer::getGlobalAcceleratedImageBufferCount() >=
847 MaxGlobalAcceleratedImageBufferCount) 847 MaxGlobalAcceleratedImageBufferCount)
848 return false; 848 return false;
849 849
850 return true; 850 return true;
851 } 851 }
852 852
853 namespace {
854
853 class UnacceleratedSurfaceFactory 855 class UnacceleratedSurfaceFactory
854 : public RecordingImageBufferFallbackSurfaceFactory { 856 : public RecordingImageBufferFallbackSurfaceFactory {
855 public: 857 public:
856 virtual std::unique_ptr<ImageBufferSurface> createSurface( 858 virtual std::unique_ptr<ImageBufferSurface> createSurface(
857 const IntSize& size, 859 const IntSize& size,
858 OpacityMode opacityMode, 860 OpacityMode opacityMode,
859 sk_sp<SkColorSpace> colorSpace, 861 sk_sp<SkColorSpace> colorSpace,
860 SkColorType colorType) { 862 SkColorType colorType) {
861 return WTF::wrapUnique(new UnacceleratedImageBufferSurface( 863 return WTF::wrapUnique(new UnacceleratedImageBufferSurface(
862 size, opacityMode, InitializeImagePixels, colorSpace, colorType)); 864 size, opacityMode, InitializeImagePixels, colorSpace, colorType));
863 } 865 }
864 866
865 virtual ~UnacceleratedSurfaceFactory() {} 867 virtual ~UnacceleratedSurfaceFactory() {}
866 }; 868 };
867 869
870 } // namespace
871
868 bool HTMLCanvasElement::shouldUseDisplayList(const IntSize& deviceSize) { 872 bool HTMLCanvasElement::shouldUseDisplayList(const IntSize& deviceSize) {
869 if (m_context->colorSpace() != kLegacyCanvasColorSpace) 873 if (m_context->colorSpace() != kLegacyCanvasColorSpace)
870 return false; 874 return false;
871 875
872 if (RuntimeEnabledFeatures::forceDisplayList2dCanvasEnabled()) 876 if (RuntimeEnabledFeatures::forceDisplayList2dCanvasEnabled())
873 return true; 877 return true;
874 878
875 if (!RuntimeEnabledFeatures::displayList2dCanvasEnabled()) 879 if (!RuntimeEnabledFeatures::displayList2dCanvasEnabled())
876 return false; 880 return false;
877 881
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 m_surfaceLayerBridge = WTF::wrapUnique(new CanvasSurfaceLayerBridge(this)); 1406 m_surfaceLayerBridge = WTF::wrapUnique(new CanvasSurfaceLayerBridge(this));
1403 // Creates a placeholder layer first before Surface is created. 1407 // Creates a placeholder layer first before Surface is created.
1404 m_surfaceLayerBridge->createSolidColorLayer(); 1408 m_surfaceLayerBridge->createSolidColorLayer();
1405 } 1409 }
1406 1410
1407 void HTMLCanvasElement::OnWebLayerReplaced() { 1411 void HTMLCanvasElement::OnWebLayerReplaced() {
1408 setNeedsCompositingUpdate(); 1412 setNeedsCompositingUpdate();
1409 } 1413 }
1410 1414
1411 } // namespace blink 1415 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698