27 মার্চ, 2025 থেকে, আমরা AOSP তৈরি করতে এবং অবদান রাখতে aosp-main
এর পরিবর্তে android-latest-release
ব্যবহার করার পরামর্শ দিচ্ছি। আরও তথ্যের জন্য, AOSP-তে পরিবর্তনগুলি দেখুন।
গ্রাফিক্স আর্কিটেকচার
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
সারফেস, সারফেসহোল্ডার, EGLSurface, SurfaceView, GLSurfaceView, SurfaceTexture, TextureView, SurfaceFlinger এবং Vulkan সম্পর্কে প্রত্যেক ডেভেলপারের যা জানা উচিত।
এই পৃষ্ঠাটি Android সিস্টেম-স্তরের গ্রাফিক্স আর্কিটেকচারের প্রয়োজনীয় উপাদান এবং অ্যাপ ফ্রেমওয়ার্ক এবং মাল্টিমিডিয়া সিস্টেম দ্বারা কীভাবে ব্যবহার করা হয় তা বর্ণনা করে। গ্রাফিকাল ডেটার বাফারগুলি কীভাবে সিস্টেমের মধ্য দিয়ে চলে তার উপর ফোকাস করা হয়। আপনি যদি কখনও ভেবে থাকেন যে সারফেসভিউ এবং টেক্সচারভিউ কেন তারা যেভাবে আচরণ করে বা কীভাবে সারফেস এবং ইজিএলসার্ফেস ইন্টারঅ্যাক্ট করে, আপনি সঠিক জায়গায় আছেন।
অ্যান্ড্রয়েড ডিভাইস এবং অ্যাপ বিকাশের সাথে কিছু পরিচিতি অনুমান করা হয়। আপনার অ্যাপ ফ্রেমওয়ার্কের বিশদ জ্ঞানের প্রয়োজন নেই এবং খুব কম API কল উল্লেখ করা হয়েছে, তবে উপাদানটি অন্যান্য পাবলিক ডকুমেন্টেশনের সাথে ওভারল্যাপ করে না। লক্ষ্য হল একটি অ্যাপ ডিজাইন করার সময় আপনাকে অবগত পছন্দ করতে সাহায্য করার জন্য আউটপুটের জন্য একটি ফ্রেম রেন্ডার করার সাথে জড়িত উল্লেখযোগ্য ইভেন্টগুলির বিশদ প্রদান করা। এটি অর্জনের জন্য, আমরা UI ক্লাসগুলি কীভাবে ব্যবহার করা যেতে পারে তার চেয়ে কীভাবে কাজ করে তা বর্ণনা করে নীচে থেকে কাজ করি।
এই বিভাগে বেশ কয়েকটি পৃষ্ঠা রয়েছে যা ব্যাকগ্রাউন্ড উপাদান থেকে শুরু করে এইচএএল বিস্তারিত কেস ব্যবহার করার জন্য সবকিছু কভার করে। এটি অ্যান্ড্রয়েড গ্রাফিক্স বাফারগুলির একটি ব্যাখ্যা দিয়ে শুরু হয়, কম্পোজিশন এবং ডিসপ্লে মেকানিজম বর্ণনা করে, তারপর উচ্চ-স্তরের মেকানিজমের দিকে এগিয়ে যায় যা কম্পোজিটরকে ডেটা সরবরাহ করে। আমরা আকর্ষণীয় বলে মনে হয় এমন একটি বিষয় এড়িয়ে যাওয়ার পরিবর্তে নীচে তালিকাভুক্ত পৃষ্ঠাগুলি পড়ার পরামর্শ দিই৷
নিম্ন স্তরের উপাদান
- বাফার কিউ এবং গ্র্যালক । BufferQueue এমন কিছু সংযোগ করে যা গ্রাফিকাল ডেটার বাফার তৈরি করে ( উৎপাদক ) এমন কিছুর সাথে যা প্রদর্শন বা আরও প্রক্রিয়াকরণের জন্য ডেটা গ্রহণ করে ( ভোক্তা )। বাফার বরাদ্দ একটি বিক্রেতা-নির্দিষ্ট HAL ইন্টারফেসের মাধ্যমে বাস্তবায়িত gralloc মেমরি বরাদ্দকারীর মাধ্যমে সঞ্চালিত হয়।
- সারফেসফ্লিংগার, হার্ডওয়্যার কম্পোজার এবং ভার্চুয়াল ডিসপ্লে । SurfaceFlinger একাধিক উৎস থেকে ডেটার বাফার গ্রহণ করে, সেগুলিকে কম্পোজ করে এবং ডিসপ্লেতে পাঠায়৷ হার্ডওয়্যার কম্পোজার HAL (HWC) উপলব্ধ হার্ডওয়্যারের সাথে কম্পোজিট বাফারের সবচেয়ে কার্যকর উপায় নির্ধারণ করে এবং ভার্চুয়াল ডিসপ্লেগুলি সিস্টেমের মধ্যে কম্পোজিট আউটপুট উপলব্ধ করে (স্ক্রিন রেকর্ড করা বা একটি নেটওয়ার্কের মাধ্যমে স্ক্রিন পাঠানো)।
- সারফেস, ক্যানভাস এবং সারফেসহোল্ডার । একটি পৃষ্ঠ একটি বাফার সারি তৈরি করে যা প্রায়শই SurfaceFlinger দ্বারা গ্রাস করা হয়। একটি পৃষ্ঠের উপর রেন্ডার করার সময়, ফলাফলটি একটি বাফারে শেষ হয় যা ভোক্তার কাছে পাঠানো হয়। ক্যানভাস এপিআই একটি সফ্টওয়্যার বাস্তবায়ন (হার্ডওয়্যার-ত্বরণ সমর্থন সহ) একটি পৃষ্ঠে সরাসরি আঁকার জন্য প্রদান করে (ওপেনজিএল ইএস-এর নিম্ন-স্তরের বিকল্প)। একটি দৃশ্যের সাথে যা কিছু করতে হবে তাতে একটি সারফেসহোল্ডার জড়িত, যার APIগুলি আকার এবং বিন্যাসের মতো পৃষ্ঠের পরামিতিগুলি পেতে এবং সেট করতে সক্ষম করে৷
- EGLSurface এবং OpenGL ES । OpenGL ES (GLES) একটি গ্রাফিক্স-রেন্ডারিং API সংজ্ঞায়িত করে যা EGL এর সাথে একত্রিত করার জন্য ডিজাইন করা হয়েছে, একটি লাইব্রেরি যা অপারেটিং সিস্টেমের মাধ্যমে উইন্ডোজ তৈরি এবং অ্যাক্সেস করতে পারে (টেক্সচার্ড বহুভুজ আঁকতে, GLES কল ব্যবহার করুন; স্ক্রিনে রেন্ডারিং রাখতে, EGL কল ব্যবহার করুন ) এই পৃষ্ঠাটি ANativeWindowও কভার করে, জাভা সারফেস ক্লাসের C/C++ সমতুল্য যা নেটিভ কোড থেকে একটি EGL উইন্ডো পৃষ্ঠ তৈরি করতে ব্যবহৃত হয়।
- ভলকান ভলকান হল একটি নিম্ন-ওভারহেড, উচ্চ-পারফরম্যান্স 3D গ্রাফিক্সের জন্য ক্রস-প্ল্যাটফর্ম API। OpenGL ES এর মতো, Vulkan অ্যাপগুলিতে উচ্চ-মানের, রিয়েল-টাইম গ্রাফিক্স তৈরি করার জন্য সরঞ্জাম সরবরাহ করে। ভলকান সুবিধার মধ্যে রয়েছে CPU ওভারহেড হ্রাস এবং SPIR-V বাইনারি ইন্টারমিডিয়েট ভাষার জন্য সমর্থন।
উচ্চ স্তরের উপাদান
- SurfaceView এবং GLSurfaceView । SurfaceView একটি পৃষ্ঠ এবং একটি দৃশ্যকে একত্রিত করে। SurfaceView-এর ভিউ উপাদানগুলি SurfaceFlinger (এবং অ্যাপ নয়), একটি পৃথক থ্রেড/প্রক্রিয়া থেকে রেন্ডারিং এবং অ্যাপ UI রেন্ডারিং থেকে বিচ্ছিন্নতা সক্ষম করে। GLSurfaceView EGL প্রসঙ্গ, আন্তঃথ্রেড যোগাযোগ, এবং কার্যকলাপ জীবনচক্রের সাথে মিথস্ক্রিয়া পরিচালনা করতে সহায়ক ক্লাস প্রদান করে (কিন্তু GLES ব্যবহার করার প্রয়োজন নেই)।
- পৃষ্ঠ জমিন . সারফেসটেক্সচার একটি পৃষ্ঠ এবং GLES টেক্সচারকে একত্রিত করে একটি BufferQueue তৈরি করে যার জন্য আপনার অ্যাপ গ্রাহক। যখন একটি প্রযোজক একটি নতুন বাফার সারিবদ্ধ করে, তখন এটি আপনার অ্যাপকে অবহিত করে, যা পূর্বে রাখা বাফারটি প্রকাশ করে, সারি থেকে নতুন বাফারটি অর্জন করে এবং EGL কল করে যাতে বাফারটিকে একটি বাহ্যিক টেক্সচার হিসাবে GLES-এর কাছে উপলব্ধ করা হয়। Android 7.0 সুরক্ষিত ভিডিও সামগ্রীর GPU পোস্ট-প্রসেসিং সক্ষম করে সুরক্ষিত টেক্সচার ভিডিও প্লেব্যাকের জন্য সমর্থন যোগ করেছে।
- টেক্সচারভিউ । টেক্সচারভিউ একটি সারফেসটেক্সচারের সাথে একটি দৃশ্যকে একত্রিত করে। টেক্সচারভিউ একটি সারফেসটেক্সচারকে মোড়ানো এবং কলব্যাকের প্রতিক্রিয়া এবং নতুন বাফারগুলি অর্জনের দায়িত্ব নেয়। আঁকার সময়, TextureView অতি সম্প্রতি প্রাপ্ত বাফারের বিষয়বস্তুকে তার ডেটা উৎস হিসেবে ব্যবহার করে, যেখানেই হোক না কেন ভিউ স্টেট নির্দেশ করে যে এটি করা উচিত। ভিউ কম্পোজিশন সর্বদা GLES এর সাথে সঞ্চালিত হয়, যার অর্থ বিষয়বস্তুর আপডেট অন্যান্য ভিউ উপাদানগুলিকেও পুনরায় আঁকতে পারে।
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি Content License-এ বর্ণিত লাইসেন্সের অধীনস্থ। Java এবং OpenJDK হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-29 UTC-তে শেষবার আপডেট করা হয়েছে।
[[["সহজে বোঝা যায়","easyToUnderstand","thumb-up"],["আমার সমস্যার সমাধান হয়েছে","solvedMyProblem","thumb-up"],["অন্যান্য","otherUp","thumb-up"]],[["এতে আমার প্রয়োজনীয় তথ্য নেই","missingTheInformationINeed","thumb-down"],["খুব জটিল / অনেক ধাপ","tooComplicatedTooManySteps","thumb-down"],["পুরনো","outOfDate","thumb-down"],["অনুবাদ সংক্রান্ত সমস্যা","translationIssue","thumb-down"],["নমুনা / কোড সংক্রান্ত সমস্যা","samplesCodeIssue","thumb-down"],["অন্যান্য","otherDown","thumb-down"]],["2025-07-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# Graphics architecture\n\n*What every developer should know about surfaces, SurfaceHolder,\nEGLSurface, SurfaceView, GLSurfaceView, SurfaceTexture, TextureView,\nSurfaceFlinger, and Vulkan.*\n\nThis page describes essential elements of the Android system-level graphics\narchitecture and how they are used by the app framework and multimedia\nsystem. The focus is on how buffers of graphical data move through the system.\nIf you've ever wondered why SurfaceView and TextureView behave the way they do,\nor how surfaces and EGLSurface interact, you're in the correct place.\n\nSome familiarity with Android devices and app development is assumed.\nYou don't need detailed knowledge of the app framework and very few API calls\nare mentioned, but the material doesn't overlap with other public\ndocumentation. The goal is to provide details on the significant events\ninvolved in rendering a frame for output to help you make informed choices\nwhen designing an app. To achieve this, we work from the bottom up,\ndescribing how the UI classes work rather than how they can be used.\n\nThis section includes several pages covering everything from background\nmaterial to HAL details to use cases. It starts with an explanation of Android\ngraphics buffers, describes the composition and display mechanism, then proceeds\nto the higher-level mechanisms that supply the compositor with data. We\nrecommend reading pages in the order listed below rather than skipping to a\ntopic that sounds interesting.\n\nLow-level components\n--------------------\n\n- [BufferQueue and\n gralloc](/docs/core/graphics/arch-bq-gralloc). BufferQueue connects something that generates buffers of graphical data (the *producer* ) to something that accepts the data for display or further processing (the *consumer* ). Buffer allocations are performed through the *gralloc* memory allocator implemented through a vendor-specific HAL interface.\n- [SurfaceFlinger,\n Hardware Composer, and virtual displays](/docs/core/graphics/arch-sf-hwc). SurfaceFlinger accepts buffers of data from multiple sources, composites them, and sends them to the display. The Hardware Composer HAL (HWC) determines the most efficient way to composite buffers with the available hardware, and virtual displays make composited output available within the system (recording the screen or sending the screen over a network).\n- [Surface, canvas, and\n SurfaceHolder](/docs/core/graphics/arch-sh). A surface produces a buffer queue that is often consumed by SurfaceFlinger. When rendering onto a surface, the result ends up in a buffer that gets shipped to the consumer. Canvas APIs provide a software implementation (with hardware-acceleration support) for drawing directly on a surface (low-level alternative to OpenGL ES). Anything having to do with a view involves a SurfaceHolder, whose APIs enable getting and setting surface parameters such as size and format.\n- [EGLSurface and\n OpenGL ES](/docs/core/graphics/arch-egl-opengl). [OpenGL ES (GLES)](https://www.khronos.org/opengles/) defines a graphics-rendering API designed to be combined with [EGL](https://www.khronos.org/egl), a library that can create and access windows through the operating system (to draw textured polygons, use GLES calls; to put rendering on the screen, use EGL calls). This page also covers ANativeWindow, the C/C++ equivalent of the Java Surface class used to create an EGL window surface from native code.\n- [Vulkan](/docs/core/graphics/arch-vulkan). Vulkan is a low-overhead, cross-platform API for high-performance 3D graphics. Like OpenGL ES, Vulkan provides tools for creating high-quality, real-time graphics in apps. Vulkan advantages include reductions in CPU overhead and support for the [SPIR-V Binary Intermediate](https://www.khronos.org/spir) language.\n\nHigh-level components\n---------------------\n\n- [SurfaceView and\n GLSurfaceView](/docs/core/graphics/arch-sv-glsv). SurfaceView combines a surface and a view. SurfaceView's view components are composited by SurfaceFlinger (and not the app), enabling rendering from a separate thread/process and isolation from app UI rendering. GLSurfaceView provides helper classes to manage EGL contexts, interthread communication, and interaction with the activity lifecycle (but isn't required to use GLES).\n- [SurfaceTexture](/docs/core/graphics/arch-st). SurfaceTexture combines a surface and GLES texture to create a BufferQueue for which your app is the consumer. When a producer queues a new buffer, it notifies your app, which in turn releases the previously-held buffer, acquires the new buffer from the queue, and makes EGL calls to make the buffer available to GLES as an external texture. Android 7.0 added support for secure texture video playback enabling GPU post-processing of protected video content.\n- [TextureView](/docs/core/graphics/arch-tv). TextureView combines a view with a SurfaceTexture. TextureView wraps a SurfaceTexture and takes responsibility for responding to callbacks and acquiring new buffers. When drawing, TextureView uses the contents of the most recently received buffer as its data source, rendering wherever and however the view state indicates it should. View composition is always performed with GLES, meaning updates to contents may cause other view elements to redraw as well."]]