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

Side by Side Diff: sky/engine/core/html/HTMLCanvasElement.cpp

Issue 865153004: Remove dead code related to compositing from Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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) 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 } 283 }
284 284
285 HashSet<RawPtr<CanvasObserver> >::iterator end = m_observers.end(); 285 HashSet<RawPtr<CanvasObserver> >::iterator end = m_observers.end();
286 for (HashSet<RawPtr<CanvasObserver> >::iterator it = m_observers.begin(); it != end; ++it) 286 for (HashSet<RawPtr<CanvasObserver> >::iterator it = m_observers.begin(); it != end; ++it)
287 (*it)->canvasResized(this); 287 (*it)->canvasResized(this);
288 } 288 }
289 289
290 bool HTMLCanvasElement::paintsIntoCanvasBuffer() const 290 bool HTMLCanvasElement::paintsIntoCanvasBuffer() const
291 { 291 {
292 ASSERT(m_context); 292 ASSERT(m_context);
293
294 if (!m_context->isAccelerated())
295 return true;
296
297 if (renderBox() && renderBox()->hasAcceleratedCompositing())
298 return false;
299
300 return true; 293 return true;
301 } 294 }
302 295
303
304 void HTMLCanvasElement::paint(GraphicsContext* context, const LayoutRect& r) 296 void HTMLCanvasElement::paint(GraphicsContext* context, const LayoutRect& r)
305 { 297 {
306 if (m_context) { 298 if (m_context) {
307 if (!paintsIntoCanvasBuffer()) 299 if (!paintsIntoCanvasBuffer())
308 return; 300 return;
309 m_context->paintRenderingResultsToCanvas(); 301 m_context->paintRenderingResultsToCanvas();
310 } 302 }
311 303
312 if (hasImageBuffer()) { 304 if (hasImageBuffer()) {
313 ImageBuffer* imageBuffer = buffer(); 305 ImageBuffer* imageBuffer = buffer();
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 } 650 }
659 return m_imageBuffer->copyImage(DontCopyBackingStore, Unscaled); 651 return m_imageBuffer->copyImage(DontCopyBackingStore, Unscaled);
660 } 652 }
661 653
662 FloatSize HTMLCanvasElement::sourceSize() const 654 FloatSize HTMLCanvasElement::sourceSize() const
663 { 655 {
664 return FloatSize(width(), height()); 656 return FloatSize(width(), height());
665 } 657 }
666 658
667 } 659 }
OLDNEW
« no previous file with comments | « sky/engine/core/frame/SettingsDelegate.h ('k') | sky/engine/core/html/canvas/WebGLRenderingContextBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698