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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h

Issue 2825183002: Plumb CanvasColorParams to canvas image classes (Closed)
Patch Set: Require both runtime flags Created 3 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) 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 namespace gles2 { 59 namespace gles2 {
60 class GLES2Interface; 60 class GLES2Interface;
61 } 61 }
62 } 62 }
63 63
64 namespace WTF { 64 namespace WTF {
65 class ArrayBufferContents; 65 class ArrayBufferContents;
66 } 66 }
67 67
68 namespace blink { 68 namespace blink {
69 class CanvasColorParams;
69 class Extensions3DUtil; 70 class Extensions3DUtil;
70 class StaticBitmapImage; 71 class StaticBitmapImage;
71 class WebExternalTextureLayer; 72 class WebExternalTextureLayer;
72 class WebGraphicsContext3DProvider; 73 class WebGraphicsContext3DProvider;
73 class WebGraphicsContext3DProviderWrapper; 74 class WebGraphicsContext3DProviderWrapper;
74 class WebLayer; 75 class WebLayer;
75 76
76 // Manages a rendering target (framebuffer + attachment) for a canvas. Can 77 // Manages a rendering target (framebuffer + attachment) for a canvas. Can
77 // publish its rendering results to a WebLayer for compositing. 78 // publish its rendering results to a WebLayer for compositing.
78 class PLATFORM_EXPORT DrawingBuffer 79 class PLATFORM_EXPORT DrawingBuffer
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 std::unique_ptr<WebGraphicsContext3DProvider>, 115 std::unique_ptr<WebGraphicsContext3DProvider>,
115 Client*, 116 Client*,
116 const IntSize&, 117 const IntSize&,
117 bool premultiplied_alpha, 118 bool premultiplied_alpha,
118 bool want_alpha_channel, 119 bool want_alpha_channel,
119 bool want_depth_buffer, 120 bool want_depth_buffer,
120 bool want_stencil_buffer, 121 bool want_stencil_buffer,
121 bool want_antialiasing, 122 bool want_antialiasing,
122 PreserveDrawingBuffer, 123 PreserveDrawingBuffer,
123 WebGLVersion, 124 WebGLVersion,
124 ChromiumImageUsage); 125 ChromiumImageUsage,
126 const CanvasColorParams&);
125 static void ForceNextDrawingBufferCreationToFail(); 127 static void ForceNextDrawingBufferCreationToFail();
126 128
127 ~DrawingBuffer() override; 129 ~DrawingBuffer() override;
128 130
129 // Destruction will be completed after all mailboxes are released. 131 // Destruction will be completed after all mailboxes are released.
130 void BeginDestruction(); 132 void BeginDestruction();
131 133
132 // Issues a glClear() on all framebuffers associated with this DrawingBuffer. 134 // Issues a glClear() on all framebuffers associated with this DrawingBuffer.
133 void ClearFramebuffers(GLbitfield clear_mask); 135 void ClearFramebuffers(GLbitfield clear_mask);
134 136
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 DrawingBuffer(std::unique_ptr<WebGraphicsContext3DProvider>, 236 DrawingBuffer(std::unique_ptr<WebGraphicsContext3DProvider>,
235 std::unique_ptr<Extensions3DUtil>, 237 std::unique_ptr<Extensions3DUtil>,
236 Client*, 238 Client*,
237 bool discard_framebuffer_supported, 239 bool discard_framebuffer_supported,
238 bool want_alpha_channel, 240 bool want_alpha_channel,
239 bool premultiplied_alpha, 241 bool premultiplied_alpha,
240 PreserveDrawingBuffer, 242 PreserveDrawingBuffer,
241 WebGLVersion, 243 WebGLVersion,
242 bool wants_depth, 244 bool wants_depth,
243 bool wants_stencil, 245 bool wants_stencil,
244 ChromiumImageUsage); 246 ChromiumImageUsage,
247 const CanvasColorParams&);
245 248
246 bool Initialize(const IntSize&, bool use_multisampling); 249 bool Initialize(const IntSize&, bool use_multisampling);
247 250
248 // Shared memory bitmaps that were released by the compositor and can be used 251 // Shared memory bitmaps that were released by the compositor and can be used
249 // again by this DrawingBuffer. 252 // again by this DrawingBuffer.
250 struct RecycledBitmap { 253 struct RecycledBitmap {
251 std::unique_ptr<cc::SharedBitmap> bitmap; 254 std::unique_ptr<cc::SharedBitmap> bitmap;
252 IntSize size; 255 IntSize size;
253 }; 256 };
254 Vector<RecycledBitmap> recycled_bitmaps_; 257 Vector<RecycledBitmap> recycled_bitmaps_;
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 // RuntimeEnabledFeatures::webGLImageChromiumEnabled() call with 531 // RuntimeEnabledFeatures::webGLImageChromiumEnabled() call with
529 // shouldUseChromiumImage() calls, and set m_chromiumImageUsage to 532 // shouldUseChromiumImage() calls, and set m_chromiumImageUsage to
530 // DisallowChromiumImage in the case of OffscreenCanvas. 533 // DisallowChromiumImage in the case of OffscreenCanvas.
531 ChromiumImageUsage chromium_image_usage_; 534 ChromiumImageUsage chromium_image_usage_;
532 bool ShouldUseChromiumImage(); 535 bool ShouldUseChromiumImage();
533 }; 536 };
534 537
535 } // namespace blink 538 } // namespace blink
536 539
537 #endif // DrawingBuffer_h 540 #endif // DrawingBuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698