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

Side by Side Diff: Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp

Issue 9969020: Merge 112568 - [chromium] Ensure framebuffer exists at the start of beginDrawingFrame. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 8 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 ASSERT(isMainThread()); 86 ASSERT(isMainThread());
87 ASSERT(!m_started); 87 ASSERT(!m_started);
88 } 88 }
89 89
90 bool CCThreadProxy::compositeAndReadback(void *pixels, const IntRect& rect) 90 bool CCThreadProxy::compositeAndReadback(void *pixels, const IntRect& rect)
91 { 91 {
92 TRACE_EVENT("CCThreadPRoxy::compositeAndReadback", this, 0); 92 TRACE_EVENT("CCThreadPRoxy::compositeAndReadback", this, 0);
93 ASSERT(isMainThread()); 93 ASSERT(isMainThread());
94 ASSERT(m_layerTreeHost); 94 ASSERT(m_layerTreeHost);
95 95
96 ScopedEnsureFramebufferAllocation ensureFramebuffer(m_layerTreeHostImpl->lay erRenderer());
97
98 if (!m_layerRendererInitialized) { 96 if (!m_layerRendererInitialized) {
99 TRACE_EVENT("compositeAndReadback_EarlyOut_LR_Uninitialized", this, 0); 97 TRACE_EVENT("compositeAndReadback_EarlyOut_LR_Uninitialized", this, 0);
100 return false; 98 return false;
101 } 99 }
102 100
103 101
104 // Perform a synchronous commit. 102 // Perform a synchronous commit.
105 CCCompletionEvent beginFrameCompletion; 103 CCCompletionEvent beginFrameCompletion;
106 CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::for ceBeginFrameOnImplThread, AllowCrossThreadAccess(&beginFrameCompletion))); 104 CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::for ceBeginFrameOnImplThread, AllowCrossThreadAccess(&beginFrameCompletion)));
107 beginFrameCompletion.wait(); 105 beginFrameCompletion.wait();
(...skipping 10 matching lines...) Expand all
118 116
119 void CCThreadProxy::requestReadbackOnImplThread(ReadbackRequest* request) 117 void CCThreadProxy::requestReadbackOnImplThread(ReadbackRequest* request)
120 { 118 {
121 ASSERT(CCProxy::isImplThread()); 119 ASSERT(CCProxy::isImplThread());
122 ASSERT(!m_readbackRequestOnImplThread); 120 ASSERT(!m_readbackRequestOnImplThread);
123 if (!m_layerTreeHostImpl) { 121 if (!m_layerTreeHostImpl) {
124 request->success = false; 122 request->success = false;
125 request->completion.signal(); 123 request->completion.signal();
126 return; 124 return;
127 } 125 }
126
128 m_readbackRequestOnImplThread = request; 127 m_readbackRequestOnImplThread = request;
129 m_schedulerOnImplThread->setNeedsRedraw(); 128 m_schedulerOnImplThread->setNeedsRedraw();
130 m_schedulerOnImplThread->setNeedsForcedRedraw(); 129 m_schedulerOnImplThread->setNeedsForcedRedraw();
131 } 130 }
132 131
133 void CCThreadProxy::startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, double duration) 132 void CCThreadProxy::startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, double duration)
134 { 133 {
135 ASSERT(CCProxy::isMainThread()); 134 ASSERT(CCProxy::isMainThread());
136 CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::req uestStartPageScaleAnimationOnImplThread, targetPosition, useAnchor, scale, durat ion)); 135 CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::req uestStartPageScaleAnimationOnImplThread, targetPosition, useAnchor, scale, durat ion));
137 } 136 }
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->con tentsTextureAllocator()); 756 m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->con tentsTextureAllocator());
758 *recreateSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(adoptRef(c ontextPtr)); 757 *recreateSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(adoptRef(c ontextPtr));
759 if (*recreateSucceeded) { 758 if (*recreateSucceeded) {
760 *capabilities = m_layerTreeHostImpl->layerRendererCapabilities(); 759 *capabilities = m_layerTreeHostImpl->layerRendererCapabilities();
761 m_schedulerOnImplThread->didRecreateContext(); 760 m_schedulerOnImplThread->didRecreateContext();
762 } 761 }
763 completion->signal(); 762 completion->signal();
764 } 763 }
765 764
766 } // namespace WebCore 765 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp ('k') | Source/WebKit/chromium/ChangeLog » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698