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

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

Issue 352873002: [wip] image color correction (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "core/page/FrameTree.h" 50 #include "core/page/FrameTree.h"
51 #include "core/page/PageLifecycleNotifier.h" 51 #include "core/page/PageLifecycleNotifier.h"
52 #include "core/page/PointerLockController.h" 52 #include "core/page/PointerLockController.h"
53 #include "core/page/StorageClient.h" 53 #include "core/page/StorageClient.h"
54 #include "core/page/ValidationMessageClient.h" 54 #include "core/page/ValidationMessageClient.h"
55 #include "core/page/scrolling/ScrollingCoordinator.h" 55 #include "core/page/scrolling/ScrollingCoordinator.h"
56 #include "core/rendering/FastTextAutosizer.h" 56 #include "core/rendering/FastTextAutosizer.h"
57 #include "core/rendering/RenderView.h" 57 #include "core/rendering/RenderView.h"
58 #include "core/rendering/TextAutosizer.h" 58 #include "core/rendering/TextAutosizer.h"
59 #include "core/storage/StorageNamespace.h" 59 #include "core/storage/StorageNamespace.h"
60 #include "platform/graphics/BitmapImage.h"
61 #include "platform/graphics/GraphicsScreen.h"
60 #include "platform/plugins/PluginData.h" 62 #include "platform/plugins/PluginData.h"
61 #include "wtf/HashMap.h" 63 #include "wtf/HashMap.h"
62 #include "wtf/RefCountedLeakCounter.h" 64 #include "wtf/RefCountedLeakCounter.h"
63 #include "wtf/StdLibExtras.h" 65 #include "wtf/StdLibExtras.h"
64 #include "wtf/text/Base64.h" 66 #include "wtf/text/Base64.h"
65 67
66 namespace WebCore { 68 namespace WebCore {
67 69
68 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, pageCounter, ("Page")); 70 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, pageCounter, ("Page"));
69 71
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 void Page::updateAcceleratedCompositingSettings() 550 void Page::updateAcceleratedCompositingSettings()
549 { 551 {
550 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext() ) { 552 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext() ) {
551 if (!frame->isLocalFrame()) 553 if (!frame->isLocalFrame())
552 continue; 554 continue;
553 if (FrameView* view = toLocalFrame(frame)->view()) 555 if (FrameView* view = toLocalFrame(frame)->view())
554 view->updateAcceleratedCompositingSettings(); 556 view->updateAcceleratedCompositingSettings();
555 } 557 }
556 } 558 }
557 559
560 void Page::deviceColorProfileChanged(const char* profile, size_t size)
561 {
562 HashSet<ImageResource*> colorProfiledImages;
563
564 setScreenColorProfile(reinterpret_cast<long long>(this), profile, size);
565
566 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext() ) {
567 // FIXME: How do OOPIF intend to co-ordinate their repaints with the pag e when high
568 // dpi and color profile changes update to the page()s screen? See crbug .com/239624
569 // to see what happens when paint does not co-ordinate with the screen u pdates sent
570 // by the Browser::RWH::WasResized IPC.
571 if (!frame->isLocalFrame())
572 continue;
573 const ResourceFetcher::DocumentResourceMap& resources = toLocalFrame(fra me)->document()->fetcher()->allResources();
574 for (ResourceFetcher::DocumentResourceMap::const_iterator it = resources .begin(); it != resources.end(); ++it) {
575 Resource* resource = it->value.get();
576 if (!resource->isImage())
577 continue;
578 ImageResource* imageResource = toImageResource(resource);
579 if (!imageResource->image()->isBitmapImage())
580 continue;
581 if (imageResource->errorOccurred())
582 continue;
583 if (toBitmapImage(imageResource->image())->hasColorProfile())
584 colorProfiledImages.add(imageResource);
585 }
586 }
587
588 if (!colorProfiledImages.isEmpty())
589 ImageResource::updateBitmapImages(colorProfiledImages);
590 }
591
558 void Page::didCommitLoad(LocalFrame* frame) 592 void Page::didCommitLoad(LocalFrame* frame)
559 { 593 {
560 lifecycleNotifier().notifyDidCommitLoad(frame); 594 lifecycleNotifier().notifyDidCommitLoad(frame);
561 if (m_mainFrame == frame) { 595 if (m_mainFrame == frame) {
562 useCounter().didCommitLoad(); 596 useCounter().didCommitLoad();
563 m_inspectorController->didCommitLoadForMainFrame(); 597 m_inspectorController->didCommitLoadForMainFrame();
564 } 598 }
565 } 599 }
566 600
567 void Page::acceptLanguagesChanged() 601 void Page::acceptLanguagesChanged()
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 // Disable all agents prior to resetting the frame view. 643 // Disable all agents prior to resetting the frame view.
610 m_inspectorController->willBeDestroyed(); 644 m_inspectorController->willBeDestroyed();
611 645
612 if (m_mainFrame->isLocalFrame()) { 646 if (m_mainFrame->isLocalFrame()) {
613 toLocalFrame(m_mainFrame.get())->setView(nullptr); 647 toLocalFrame(m_mainFrame.get())->setView(nullptr);
614 } else { 648 } else {
615 ASSERT(m_mainFrame->isRemoteFrame()); 649 ASSERT(m_mainFrame->isRemoteFrame());
616 toRemoteFrame(m_mainFrame.get())->setView(nullptr); 650 toRemoteFrame(m_mainFrame.get())->setView(nullptr);
617 } 651 }
618 652
653 removeScreenColorProfile(reinterpret_cast<long long>(this));
654
619 allPages().remove(this); 655 allPages().remove(this);
620 if (ordinaryPages().contains(this)) 656 if (ordinaryPages().contains(this))
621 ordinaryPages().remove(this); 657 ordinaryPages().remove(this);
622 658
623 if (m_scrollingCoordinator) 659 if (m_scrollingCoordinator)
624 m_scrollingCoordinator->willBeDestroyed(); 660 m_scrollingCoordinator->willBeDestroyed();
625 661
626 #ifndef NDEBUG 662 #ifndef NDEBUG
627 pageCounter.decrement(); 663 pageCounter.decrement();
628 #endif 664 #endif
(...skipping 15 matching lines...) Expand all
644 , spellCheckerClient(0) 680 , spellCheckerClient(0)
645 , storageClient(0) 681 , storageClient(0)
646 { 682 {
647 } 683 }
648 684
649 Page::PageClients::~PageClients() 685 Page::PageClients::~PageClients()
650 { 686 {
651 } 687 }
652 688
653 } // namespace WebCore 689 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698