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

Side by Side Diff: third_party/WebKit/Source/core/page/Page.cpp

Issue 1331533002: [poc] curve-filter Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Ensure screen device profiles are matrix Created 4 years, 12 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R ights Reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R ights Reserved.
3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 21 matching lines...) Expand all
32 #include "core/frame/FrameConsole.h" 32 #include "core/frame/FrameConsole.h"
33 #include "core/frame/FrameHost.h" 33 #include "core/frame/FrameHost.h"
34 #include "core/frame/FrameView.h" 34 #include "core/frame/FrameView.h"
35 #include "core/frame/RemoteFrame.h" 35 #include "core/frame/RemoteFrame.h"
36 #include "core/frame/RemoteFrameView.h" 36 #include "core/frame/RemoteFrameView.h"
37 #include "core/frame/Settings.h" 37 #include "core/frame/Settings.h"
38 #include "core/html/HTMLMediaElement.h" 38 #include "core/html/HTMLMediaElement.h"
39 #include "core/inspector/InspectorInstrumentation.h" 39 #include "core/inspector/InspectorInstrumentation.h"
40 #include "core/layout/LayoutView.h" 40 #include "core/layout/LayoutView.h"
41 #include "core/layout/TextAutosizer.h" 41 #include "core/layout/TextAutosizer.h"
42 #include "core/layout/svg/SVGResourcesCache.h"
42 #include "core/page/AutoscrollController.h" 43 #include "core/page/AutoscrollController.h"
43 #include "core/page/ChromeClient.h" 44 #include "core/page/ChromeClient.h"
44 #include "core/page/ContextMenuController.h" 45 #include "core/page/ContextMenuController.h"
45 #include "core/page/DragController.h" 46 #include "core/page/DragController.h"
46 #include "core/page/FocusController.h" 47 #include "core/page/FocusController.h"
47 #include "core/page/PointerLockController.h" 48 #include "core/page/PointerLockController.h"
48 #include "core/page/ValidationMessageClient.h" 49 #include "core/page/ValidationMessageClient.h"
49 #include "core/page/scrolling/ScrollingCoordinator.h" 50 #include "core/page/scrolling/ScrollingCoordinator.h"
50 #include "core/paint/PaintLayer.h" 51 #include "core/paint/PaintLayer.h"
52 #include "platform/graphics/ColorSpaceProfile.h"
51 #include "platform/graphics/GraphicsLayer.h" 53 #include "platform/graphics/GraphicsLayer.h"
54 #include "platform/graphics/GraphicsScreen.h"
52 #include "platform/plugins/PluginData.h" 55 #include "platform/plugins/PluginData.h"
53 #include "public/platform/Platform.h" 56 #include "public/platform/Platform.h"
54 57
55 namespace blink { 58 namespace blink {
56 59
57 // static 60 // static
58 WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>& Page::allPages() 61 WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>& Page::allPages()
59 { 62 {
60 DEFINE_STATIC_LOCAL(WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page> >, allPages, ()); 63 DEFINE_STATIC_LOCAL(WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page> >, allPages, ());
61 return allPages; 64 return allPages;
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 328
326 m_deviceScaleFactor = scaleFactor; 329 m_deviceScaleFactor = scaleFactor;
327 setNeedsRecalcStyleInAllFrames(); 330 setNeedsRecalcStyleInAllFrames();
328 331
329 if (mainFrame() && mainFrame()->isLocalFrame()) 332 if (mainFrame() && mainFrame()->isLocalFrame())
330 deprecatedLocalMainFrame()->deviceScaleFactorChanged(); 333 deprecatedLocalMainFrame()->deviceScaleFactorChanged();
331 } 334 }
332 335
333 void Page::setDeviceColorProfile(const Vector<char>& profile) 336 void Page::setDeviceColorProfile(const Vector<char>& profile)
334 { 337 {
335 // FIXME: implement. 338 if (!RuntimeEnabledFeatures::imageColorProfilesEnabled())
339 return;
340
341 fprintf(stderr, "\nWebCore::Page %ld setDeviceColorProfile begins\n", (long int)this);
342 fflush(stderr);
343
344 RefPtr<ColorSpaceProfile> screen = screenColorProfile(Page::screenId(this));
345
346 setScreenColorProfile(Page::screenId(this), profile.data(), profile.size());
347 setCurrentScreenId(Page::screenId(this));
348
349 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext() ) {
350 if (!frame->isLocalFrame())
351 continue;
352
353 if (LayoutView* layoutView = toLocalFrame(frame)->document()->layoutView ())
354 layoutView->invalidatePaintForViewAndCompositedLayers(true);
355
356 // Clear the SVG image pattern cache: see crbug.com/531258
357 SVGResourcesCache::invalidateAllResources(*toLocalFrame(frame)->document ());
358
359 RELEASE_ASSERT(currentScreenId() == Page::screenId(this));
360 }
361
362 if (mainFrame() && mainFrame()->isLocalFrame())
363 animator().scheduleVisualUpdate(toLocalFrame(mainFrame()));
364
365 fprintf(stderr, "WebCore::Page %ld setDeviceColorProfile ends\n\n", (long in t)this);
366 fflush(stderr);
367
368 setCurrentScreenId(0);
369
370 if (screen)
371 pruneColorTransform(screen.get());
336 } 372 }
337 373
338 void Page::resetDeviceColorProfileForTesting() 374 void Page::resetDeviceColorProfileForTesting()
339 { 375 {
376 if (RuntimeEnabledFeatures::imageColorProfilesEnabled()) {
377 fprintf(stderr, "\nWebCore::Page %ld resetDeviceColorProfileForTesting\n ", (long int)this);
378 fflush(stderr);
379 }
380
381 removeScreenColorProfile(Page::screenId(this));
382
340 RuntimeEnabledFeatures::setImageColorProfilesEnabled(false); 383 RuntimeEnabledFeatures::setImageColorProfilesEnabled(false);
341 } 384 }
342 385
343 void Page::allVisitedStateChanged(bool invalidateVisitedLinkHashes) 386 void Page::allVisitedStateChanged(bool invalidateVisitedLinkHashes)
344 { 387 {
345 for (const Page* page : ordinaryPages()) { 388 for (const Page* page : ordinaryPages()) {
346 for (Frame* frame = page->m_mainFrame; frame; frame = frame->tree().trav erseNext()) { 389 for (Frame* frame = page->m_mainFrame; frame; frame = frame->tree().trav erseNext()) {
347 if (frame->isLocalFrame()) 390 if (frame->isLocalFrame())
348 toLocalFrame(frame)->document()->visitedLinkState().invalidateSt yleForAllLinks(invalidateVisitedLinkHashes); 391 toLocalFrame(frame)->document()->visitedLinkState().invalidateSt yleForAllLinks(invalidateVisitedLinkHashes);
349 } 392 }
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 if (m_memoryPurgeController) 609 if (m_memoryPurgeController)
567 m_memoryPurgeController->unregisterClient(this); 610 m_memoryPurgeController->unregisterClient(this);
568 #endif 611 #endif
569 612
570 if (m_scrollingCoordinator) 613 if (m_scrollingCoordinator)
571 m_scrollingCoordinator->willBeDestroyed(); 614 m_scrollingCoordinator->willBeDestroyed();
572 615
573 chromeClient().chromeDestroyed(); 616 chromeClient().chromeDestroyed();
574 if (m_validationMessageClient) 617 if (m_validationMessageClient)
575 m_validationMessageClient->willBeDestroyed(); 618 m_validationMessageClient->willBeDestroyed();
619
620 removeScreenColorProfile(Page::screenId(this));
576 m_mainFrame = nullptr; 621 m_mainFrame = nullptr;
577 622
578 Page::notifyContextDestroyed(); 623 Page::notifyContextDestroyed();
579 } 624 }
580 625
581 Page::PageClients::PageClients() 626 Page::PageClients::PageClients()
582 : chromeClient(nullptr) 627 : chromeClient(nullptr)
583 , contextMenuClient(nullptr) 628 , contextMenuClient(nullptr)
584 , editorClient(nullptr) 629 , editorClient(nullptr)
585 , dragClient(nullptr) 630 , dragClient(nullptr)
586 , spellCheckerClient(nullptr) 631 , spellCheckerClient(nullptr)
587 { 632 {
588 } 633 }
589 634
590 Page::PageClients::~PageClients() 635 Page::PageClients::~PageClients()
591 { 636 {
592 } 637 }
593 638
594 template class CORE_TEMPLATE_EXPORT WillBeHeapSupplement<Page>; 639 template class CORE_TEMPLATE_EXPORT WillBeHeapSupplement<Page>;
595 640
596 } // namespace blink 641 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/Page.h ('k') | third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698