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

Unified Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 41903003: cc: Fix incomplete changes to add ETC1 support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased and moved pixel ref class to public cc Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/compositor_impl_android.cc
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index 3189e9f19c085fb9e534b5e37750fe55adee15df..081c069fc47e6ba5f1dc5fed5aeed38f3606a11e 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -22,6 +22,7 @@
#include "cc/output/compositor_frame.h"
#include "cc/output/context_provider.h"
#include "cc/output/output_surface.h"
+#include "cc/resources/etc1_pixel_ref.h"
#include "cc/resources/scoped_ui_resource.h"
#include "cc/resources/ui_resource_bitmap.h"
#include "cc/trees/layer_tree_host.h"
@@ -316,6 +317,16 @@ blink::WebGLId CompositorImpl::GenerateCompressedTexture(gfx::Size& size,
return texture_id;
}
+cc::UIResourceId CompositorImpl::GenerateCompressedUIResource(gfx::Size& size,
+ int data_size,
+ void* data) {
+ scoped_ptr<uint8_t[]> pixels(static_cast<uint8_t*>(data));
+ skia::RefPtr<cc::ETC1PixelRef> etc1_pixel_ref =
+ skia::AdoptRef(new cc::ETC1PixelRef(pixels.Pass()));
+ cc::UIResourceBitmap ui_bitmap(etc1_pixel_ref, size);
+ return GenerateUIResource(ui_bitmap);
+}
+
void CompositorImpl::DeleteTexture(blink::WebGLId texture_id) {
blink::WebGraphicsContext3D* context =
ImageTransportFactoryAndroid::GetInstance()->GetContext3D();

Powered by Google App Engine
This is Rietveld 408576698