OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "platform/tracing/TraceEvent.h" | 42 #include "platform/tracing/TraceEvent.h" |
43 #include "public/platform/Platform.h" | 43 #include "public/platform/Platform.h" |
44 #include "public/platform/WebCompositorSupport.h" | 44 #include "public/platform/WebCompositorSupport.h" |
45 #include "public/platform/WebExternalBitmap.h" | 45 #include "public/platform/WebExternalBitmap.h" |
46 #include "public/platform/WebExternalTextureLayer.h" | 46 #include "public/platform/WebExternalTextureLayer.h" |
47 #include "public/platform/WebGraphicsContext3DProvider.h" | 47 #include "public/platform/WebGraphicsContext3DProvider.h" |
48 #include "skia/ext/texture_handle.h" | 48 #include "skia/ext/texture_handle.h" |
49 #include "third_party/skia/include/gpu/GrContext.h" | 49 #include "third_party/skia/include/gpu/GrContext.h" |
50 #include "third_party/skia/include/gpu/gl/GrGLTypes.h" | 50 #include "third_party/skia/include/gpu/gl/GrGLTypes.h" |
51 #include "wtf/CheckedNumeric.h" | 51 #include "wtf/CheckedNumeric.h" |
52 #include "wtf/PtrUtil.h" | |
53 #include "wtf/typed_arrays/ArrayBufferContents.h" | 52 #include "wtf/typed_arrays/ArrayBufferContents.h" |
54 #include <algorithm> | 53 #include <algorithm> |
55 #include <memory> | 54 #include <memory> |
56 | 55 |
57 namespace blink { | 56 namespace blink { |
58 | 57 |
59 namespace { | 58 namespace { |
60 | 59 |
61 const float s_resourceAdjustedRatio = 0.5; | 60 const float s_resourceAdjustedRatio = 0.5; |
62 | 61 |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 | 751 |
753 return true; | 752 return true; |
754 } | 753 } |
755 | 754 |
756 GLuint DrawingBuffer::framebuffer() const { | 755 GLuint DrawingBuffer::framebuffer() const { |
757 return m_fbo; | 756 return m_fbo; |
758 } | 757 } |
759 | 758 |
760 WebLayer* DrawingBuffer::platformLayer() { | 759 WebLayer* DrawingBuffer::platformLayer() { |
761 if (!m_layer) { | 760 if (!m_layer) { |
762 m_layer = wrapUnique( | 761 m_layer = |
763 Platform::current()->compositorSupport()->createExternalTextureLayer( | 762 Platform::current()->compositorSupport()->createExternalTextureLayer( |
764 this)); | 763 this); |
765 | 764 |
766 m_layer->setOpaque(!m_wantAlphaChannel); | 765 m_layer->setOpaque(!m_wantAlphaChannel); |
767 m_layer->setBlendBackgroundColor(m_wantAlphaChannel); | 766 m_layer->setBlendBackgroundColor(m_wantAlphaChannel); |
768 m_layer->setPremultipliedAlpha(m_premultipliedAlpha); | 767 m_layer->setPremultipliedAlpha(m_premultipliedAlpha); |
769 m_layer->setNearestNeighbor(m_filterQuality == kNone_SkFilterQuality); | 768 m_layer->setNearestNeighbor(m_filterQuality == kNone_SkFilterQuality); |
770 GraphicsLayer::registerContentsLayer(m_layer->layer()); | 769 GraphicsLayer::registerContentsLayer(m_layer->layer()); |
771 } | 770 } |
772 | 771 |
773 return m_layer->layer(); | 772 return m_layer->layer(); |
774 } | 773 } |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 // the public interface for WebGL does not support GL_TEXTURE_RECTANGLE. | 1245 // the public interface for WebGL does not support GL_TEXTURE_RECTANGLE. |
1247 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding); | 1246 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding); |
1248 } | 1247 } |
1249 | 1248 |
1250 bool DrawingBuffer::shouldUseChromiumImage() { | 1249 bool DrawingBuffer::shouldUseChromiumImage() { |
1251 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && | 1250 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && |
1252 m_chromiumImageUsage == AllowChromiumImage; | 1251 m_chromiumImageUsage == AllowChromiumImage; |
1253 } | 1252 } |
1254 | 1253 |
1255 } // namespace blink | 1254 } // namespace blink |
OLD | NEW |