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

Side by Side Diff: sky/engine/core/html/canvas/WebGLRenderingContextBase.cpp

Issue 735033003: Remove a bunch of dead code from RenderLayer (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: cr comments Created 6 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 | « sky/engine/core/html/HTMLCanvasElement.cpp ('k') | sky/engine/core/rendering/InlineFlowBox.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) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple 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 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 if (m_framebufferBinding || isContextLost()) 777 if (m_framebufferBinding || isContextLost())
778 return; 778 return;
779 779
780 drawingBuffer()->markContentsChanged(); 780 drawingBuffer()->markContentsChanged();
781 781
782 m_layerCleared = false; 782 m_layerCleared = false;
783 RenderBox* renderBox = canvas()->renderBox(); 783 RenderBox* renderBox = canvas()->renderBox();
784 if (renderBox && renderBox->hasAcceleratedCompositing()) { 784 if (renderBox && renderBox->hasAcceleratedCompositing()) {
785 m_markedCanvasDirty = true; 785 m_markedCanvasDirty = true;
786 canvas()->clearCopiedImage(); 786 canvas()->clearCopiedImage();
787 renderBox->contentChanged(changeType);
788 } else { 787 } else {
789 if (!m_markedCanvasDirty) { 788 if (!m_markedCanvasDirty) {
790 m_markedCanvasDirty = true; 789 m_markedCanvasDirty = true;
791 canvas()->didDraw(FloatRect(FloatPoint(0, 0), clampedCanvasSize())); 790 canvas()->didDraw(FloatRect(FloatPoint(0, 0), clampedCanvasSize()));
792 } 791 }
793 } 792 }
794 } 793 }
795 794
796 bool WebGLRenderingContextBase::clearIfComposited(GLbitfield mask) 795 bool WebGLRenderingContextBase::clearIfComposited(GLbitfield mask)
797 { 796 {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 GLint maxSize = std::min(m_maxTextureSize, m_maxRenderbufferSize); 941 GLint maxSize = std::min(m_maxTextureSize, m_maxRenderbufferSize);
943 // Limit drawing buffer size to 4k to avoid memory exhaustion. 942 // Limit drawing buffer size to 4k to avoid memory exhaustion.
944 const int sizeUpperLimit = 4096; 943 const int sizeUpperLimit = 4096;
945 maxSize = std::min(maxSize, sizeUpperLimit); 944 maxSize = std::min(maxSize, sizeUpperLimit);
946 GLint maxWidth = std::min(maxSize, m_maxViewportDims[0]); 945 GLint maxWidth = std::min(maxSize, m_maxViewportDims[0]);
947 GLint maxHeight = std::min(maxSize, m_maxViewportDims[1]); 946 GLint maxHeight = std::min(maxSize, m_maxViewportDims[1]);
948 width = clamp(width, 1, maxWidth); 947 width = clamp(width, 1, maxWidth);
949 height = clamp(height, 1, maxHeight); 948 height = clamp(height, 1, maxHeight);
950 949
951 if (m_needsUpdate) { 950 if (m_needsUpdate) {
952 RenderBox* renderBox = canvas()->renderBox(); 951 // FIXME(sky): This seems wrong.
953 if (renderBox && renderBox->hasAcceleratedCompositing())
954 renderBox->contentChanged(CanvasChanged);
955 m_needsUpdate = false; 952 m_needsUpdate = false;
956 } 953 }
957 954
958 // We don't have to mark the canvas as dirty, since the newly created image buffer will also start off 955 // We don't have to mark the canvas as dirty, since the newly created image buffer will also start off
959 // clear (and this matches what reshape will do). 956 // clear (and this matches what reshape will do).
960 drawingBuffer()->reset(IntSize(width, height)); 957 drawingBuffer()->reset(IntSize(width, height));
961 restoreStateAfterClear(); 958 restoreStateAfterClear();
962 959
963 webContext()->bindTexture(GL_TEXTURE_2D, objectOrZero(m_textureUnits[m_activ eTextureUnit].m_texture2DBinding.get())); 960 webContext()->bindTexture(GL_TEXTURE_2D, objectOrZero(m_textureUnits[m_activ eTextureUnit].m_texture2DBinding.get()));
964 webContext()->bindRenderbuffer(GL_RENDERBUFFER, objectOrZero(m_renderbufferB inding.get())); 961 webContext()->bindRenderbuffer(GL_RENDERBUFFER, objectOrZero(m_renderbufferB inding.get()));
(...skipping 4648 matching lines...) Expand 10 before | Expand all | Expand 10 after
5613 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0; 5610 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0;
5614 } 5611 }
5615 #else 5612 #else
5616 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const 5613 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const
5617 { 5614 {
5618 return m_drawingBuffer.get(); 5615 return m_drawingBuffer.get();
5619 } 5616 }
5620 #endif 5617 #endif
5621 5618
5622 } // namespace blink 5619 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/html/HTMLCanvasElement.cpp ('k') | sky/engine/core/rendering/InlineFlowBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698